瀏覽代碼

* fixed occassional crash during InitArguments

git-svn-id: trunk@2112 -
Tomas Hajny 19 年之前
父節點
當前提交
6d96ee4819
共有 1 個文件被更改,包括 2 次插入8 次删除
  1. 2 8
      rtl/os2/system.pas

+ 2 - 8
rtl/os2/system.pas

@@ -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. *)