mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 13:08:00 +02:00
* fixed occassional crash during InitArguments
git-svn-id: trunk@2112 -
This commit is contained in:
parent
6d3ae16267
commit
6d96ee4819
@ -526,16 +526,10 @@ begin
|
||||
PC := PChar (PIB^.Cmd) + ArgLen;
|
||||
|
||||
(* ArgLen contains size of command line arguments including leading space. *)
|
||||
ArgLen := StrLen (PC);
|
||||
(* Just to make sure the leading space is there for all OS/2 versions... *)
|
||||
if PC^ <> ' ' then
|
||||
begin
|
||||
CmdLine [ArgVLen] := ' ';
|
||||
Inc (ArgVLen);
|
||||
end;
|
||||
ArgLen := Succ (StrLen (PC));
|
||||
|
||||
SysReallocMem (CmdLine, ArgVLen + ArgLen);
|
||||
(* Ending #0 after program name gets overwritten with space from PIB^.Cmd. *)
|
||||
|
||||
Move (PC^, CmdLine [ArgVLen], Succ (ArgLen));
|
||||
|
||||
(* ArgV has space for 8 parameters from the first allocation. *)
|
||||
|
Loading…
Reference in New Issue
Block a user