Browse Source

* use selecttext under linux

peter 25 years ago
parent
commit
1b3b30ffce
1 changed files with 15 additions and 1 deletions
  1. 15 1
      tests/webtbs/tbug966.pp

+ 15 - 1
tests/webtbs/tbug966.pp

@@ -8,7 +8,13 @@
 {$endif win32}
 {$endif win32}
 
 
 {$ifdef has_sockets}
 {$ifdef has_sockets}
-uses crt,Sockets;
+uses
+{$ifdef linux}
+  linux,
+{$else}
+  crt,
+{$endif}
+  Sockets;
 Var
 Var
  S : Longint ; Sin,Sout: Text;
  S : Longint ; Sin,Sout: Text;
  Temp, Temp2 : Char;
  Temp, Temp2 : Char;
@@ -33,6 +39,13 @@ const
     var
     var
       temp2 : char;
       temp2 : char;
     begin
     begin
+{$ifdef linux}
+      while selecttext(sin,1)>0 do
+       begin
+         read(Sin,Temp2);
+         write(Temp2);
+       end;
+{$else}
       repeat until not eof(sin);
       repeat until not eof(sin);
       while not eof(sin) do
       while not eof(sin) do
         begin
         begin
@@ -40,6 +53,7 @@ const
           write(Temp2);
           write(Temp2);
           delay(1);
           delay(1);
         end;
         end;
+{$endif}
     end;
     end;
 
 
 begin
 begin