diff --git a/compiler/utils/fpc.pp b/compiler/utils/fpc.pp index 4648660bc3..4db795ff83 100644 --- a/compiler/utils/fpc.pp +++ b/compiler/utils/fpc.pp @@ -258,6 +258,14 @@ program fpc; ppccommandlinelen : longint; i : longint; errorvalue : Longint; + + Procedure AddToCommandLine(S : String); + + begin + PPCCommandLine [PPCCommandLineLen] := S; + Inc(PPCCommandLineLen); + end; + begin setlength(ppccommandline,paramcount); ppccommandlinelen:=0; @@ -269,8 +277,7 @@ program fpc; if ParamCount = 0 then begin SetLength (PPCCommandLine, 1); - PPCCommandLine [PPCCommandLineLen] := '-?F' + ParamStr (0); - Inc (PPCCommandLineLen); + AddToCommandLine('-?F' + ParamStr (0)); end else for i:=1 to paramcount do @@ -305,12 +312,11 @@ program fpc; else begin if pos('-h',s)=1 then - ppccommandline[ppccommandlinelen] := '-hF' + ParamStr (0) + AddToCommandLine('-hF'+ParamStr(0)) else if pos('-?',s)=1 then - ppccommandline[ppccommandlinelen] := '-?F' + ParamStr (0) + AddToCommandLine('-?F'+ParamStr(0)) else - ppccommandline[ppccommandlinelen]:=s; - inc(ppccommandlinelen); + AddToCommandLine(S); end; end; end; @@ -330,3 +336,4 @@ program fpc; error(ppcbin+' returned an error exitcode'); halt(errorvalue); end. +