* fix passing of only one parameter on non unix platforms. Mantis #21630

git-svn-id: trunk@21038 -
This commit is contained in:
marco 2012-04-25 17:21:16 +00:00
parent 8f39076a69
commit 69fbbcedf3

View File

@ -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}