Browse Source

+ Fixed paramstr() - sometimes there are no 255 characters available.

michael 27 years ago
parent
commit
0fce39711b
1 changed files with 10 additions and 5 deletions
  1. 10 5
      rtl/linux/syslinux.pp

+ 10 - 5
rtl/linux/syslinux.pp

@@ -109,14 +109,17 @@ End;
 
 
 Function ParamStr(l: Longint): String;
 Function ParamStr(l: Longint): String;
 Var
 Var
-  b      : Array[0..255] of Char;
 {$ifndef crtlib}
 {$ifndef crtlib}
   i      : longint;
   i      : longint;
   pp     : ppchar;
   pp     : ppchar;
+{$else}
+  b      : Array[0..255] of Char;
+
 {$endif}
 {$endif}
 Begin
 Begin
 {$ifdef crtlib}
 {$ifdef crtlib}
   _rtl_paramstr(@b, l);
   _rtl_paramstr(@b, l);
+  ParamStr:=StrPas(b);
 {$else}
 {$else}
   if l>argc then
   if l>argc then
    begin
    begin
@@ -131,11 +134,10 @@ Begin
      inc(i);
      inc(i);
    end;
    end;
   if pp^<>nil then
   if pp^<>nil then
-   move (pp^^,b[0],255)
+    Paramstr:=StrPas(pp^)
   else
   else
-   b[0]:=#0;
+    ParamStr:='';  
 {$endif}
 {$endif}
-  ParamStr:=StrPas(b);
 End;
 End;
 
 
 
 
@@ -675,7 +677,10 @@ End.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.10  1998-07-30 13:26:15  michael
+  Revision 1.11  1998-08-11 08:30:37  michael
+  + Fixed paramstr() - sometimes there are no 255 characters available.
+
+  Revision 1.10  1998/07/30 13:26:15  michael
   + Added support for ErrorProc variable. All internal functions are required
   + Added support for ErrorProc variable. All internal functions are required
     to call HandleError instead of runerror from now on.
     to call HandleError instead of runerror from now on.
     This is necessary for exception support.
     This is necessary for exception support.