mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-10-24 00:51:42 +02:00
+ Fixed paramstr(0)
This commit is contained in:
parent
e4c9cc83b8
commit
3c33678c4e
@ -209,13 +209,24 @@ begin
|
|||||||
paramcount := argc - 1;
|
paramcount := argc - 1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ module functions }
|
||||||
|
function GetModuleFileName(l1:longint;p:pointer;l2:longint):longint;
|
||||||
|
external 'kernel32' name 'GetModuleFileNameA';
|
||||||
|
function GetModuleHandle(p : pointer) : longint;
|
||||||
|
external 'kernel32' name 'GetModuleHandleA';
|
||||||
|
function GetCommandFile:pchar;forward;
|
||||||
|
|
||||||
function paramstr(l : longint) : string;
|
function paramstr(l : longint) : string;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if (l>=0) and (l+1<=argc) then
|
|
||||||
|
if (l>0) and (l+1<=argc) then
|
||||||
paramstr:=strpas(argv[l])
|
paramstr:=strpas(argv[l])
|
||||||
else
|
else
|
||||||
paramstr:='';
|
if l=0 then
|
||||||
|
paramstr:=strpas(GetCommandFile)
|
||||||
|
else
|
||||||
|
paramstr:='';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -651,11 +662,6 @@ end;
|
|||||||
function GetCommandLine : pchar;
|
function GetCommandLine : pchar;
|
||||||
external 'kernel32' name 'GetCommandLineA';
|
external 'kernel32' name 'GetCommandLineA';
|
||||||
|
|
||||||
{ module functions }
|
|
||||||
function GetModuleFileName(l1:longint;p:pointer;l2:longint):longint;
|
|
||||||
external 'kernel32' name 'GetModuleFileNameA';
|
|
||||||
function GetModuleHandle(p : pointer) : longint;
|
|
||||||
external 'kernel32' name 'GetModuleHandleA';
|
|
||||||
|
|
||||||
var
|
var
|
||||||
ModuleName : array[0..255] of char;
|
ModuleName : array[0..255] of char;
|
||||||
@ -1016,7 +1022,10 @@ end.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.39 1999-05-17 21:52:47 florian
|
Revision 1.40 1999-06-11 16:26:40 michael
|
||||||
|
+ Fixed paramstr(0)
|
||||||
|
|
||||||
|
Revision 1.39 1999/05/17 21:52:47 florian
|
||||||
* most of the Object Pascal stuff moved to the system unit
|
* most of the Object Pascal stuff moved to the system unit
|
||||||
|
|
||||||
Revision 1.38 1999/04/28 11:42:53 peter
|
Revision 1.38 1999/04/28 11:42:53 peter
|
||||||
|
Loading…
Reference in New Issue
Block a user