mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-30 19:51:39 +01:00
+ Paramstr(0) must return binary name
This commit is contained in:
parent
ead9de924c
commit
78aa08c8be
@ -182,7 +182,17 @@ Function ParamStr(Param : Integer) : Ansistring;
|
|||||||
Var Len : longint;
|
Var Len : longint;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if (Param>=0) and (Param<argc) then
|
{
|
||||||
|
Paramstr(0) should return the name of the binary.
|
||||||
|
Since this functionality is included in the system unit,
|
||||||
|
we fetch it from there.
|
||||||
|
Normally, pathnames are less than 255 chars anyway,
|
||||||
|
so this will work correct in 99% of all cases.
|
||||||
|
In time, the system unit should get a GetExeName call.
|
||||||
|
}
|
||||||
|
if (Param=0) then
|
||||||
|
Result:=System.Paramstr(0)
|
||||||
|
else if (Param>0) and (Param<argc) then
|
||||||
begin
|
begin
|
||||||
Len:=0;
|
Len:=0;
|
||||||
While Argv[Param][Len]<>#0 do
|
While Argv[Param][Len]<>#0 do
|
||||||
@ -193,7 +203,7 @@ begin
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
paramstr:='';
|
paramstr:='';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -380,9 +390,15 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.11 2002-09-07 16:01:22 peter
|
Revision 1.12 2003-05-29 08:43:52 michael
|
||||||
|
+ Paramstr(0) must return binary name
|
||||||
|
|
||||||
|
Revision 1.11 2002/09/07 16:01:22 peter
|
||||||
* old logs removed and tabs fixed
|
* old logs removed and tabs fixed
|
||||||
|
|
||||||
|
Revision 1.1.2.3 2003/05/29 08:42:23 michael
|
||||||
|
+ Paramstr(0) must return binary name
|
||||||
|
|
||||||
Revision 1.10 2002/01/25 17:41:25 peter
|
Revision 1.10 2002/01/25 17:41:25 peter
|
||||||
* delphi compatible array types
|
* delphi compatible array types
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user