mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-03 12:49:26 +01:00
* fix passing of only one parameter on non unix platforms. Mantis #21630
git-svn-id: trunk@21038 -
This commit is contained in:
parent
8f39076a69
commit
69fbbcedf3
@ -306,7 +306,9 @@ end;
|
||||
|
||||
procedure Run(const Filename: string);
|
||||
var
|
||||
p: PPChar;
|
||||
p : PPChar;
|
||||
i : integer;
|
||||
args : array of string;
|
||||
begin
|
||||
p:=argv;
|
||||
inc(p);
|
||||
@ -317,8 +319,13 @@ begin
|
||||
inc(p);
|
||||
end;
|
||||
{$IFNDEF UseFpExecV}
|
||||
Inc(p); //lose the first command-line argument with the the script filename
|
||||
Halt(ExecuteProcess(Filename,[p^]));
|
||||
if paramcount>1 then
|
||||
begin
|
||||
setlength(args,paramcount-1);
|
||||
for i:=2 to paramcount do
|
||||
args[i-2]:=paramstr(i);
|
||||
end;
|
||||
Halt(ExecuteProcess(Filename,args));
|
||||
{$ELSE}
|
||||
Halt(FpExecV(Filename,p));
|
||||
{$ENDIF}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user