mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-20 03:50:36 +01:00
+ Fixed paramstr() - sometimes there are no 255 characters available.
This commit is contained in:
parent
0be8fdd5b8
commit
0fce39711b
@ -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.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user