瀏覽代碼

* remove fixed limit for overall size of arguments for Dos.Exec and SysUtils.ExecuteProcess

git-svn-id: trunk@28975 -
Tomas Hajny 10 年之前
父節點
當前提交
5d0bd53433
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 2 3
      rtl/os2/dos.pas
  2. 2 1
      rtl/os2/sysutils.pp

+ 2 - 3
rtl/os2/dos.pas

@@ -211,9 +211,7 @@ var
   Prio: byte;
   DSS: boolean;
   SR: SearchRec;
-
-const
-  MaxArgsSize = 3072; (* Amount of memory reserved for arguments in bytes. *)
+  MaxArgsSize: word; (* Amount of memory reserved for arguments in bytes. *)
 
 begin
 {  LastDosExitCode := Exec (Path, ExecRunFlags (ExecFlags), efDefault, ComLine);}
@@ -226,6 +224,7 @@ begin
   else
    QName := Path;
   FindClose (SR);
+  MaxArgsSize := Length (ComLine) + Length (QName) + 256; (* More than enough *)
   if ComLine = '' then
    begin
     Args0 := nil;

+ 2 - 1
rtl/os2/sysutils.pp

@@ -750,9 +750,9 @@ var
  ObjName: shortstring;
  RC: cardinal;
  ExecAppType: cardinal;
+ MaxArgsSize: word; (* Amount of memory reserved for arguments in bytes. *)
 
 const
- MaxArgsSize = 3072; (* Amount of memory reserved for arguments in bytes. *)
  ObjBufSize = 512;
 
 function StartSession: cardinal;
@@ -845,6 +845,7 @@ begin
    if (ApplicationType and 3 = ExecAppType and 3) then
 (* DosExecPgm should work... *)
     begin
+     MaxArgsSize := Length (ComLine) + Length (Path) + 256; (* More than enough *)
      if ComLine = '' then
       begin
        Args0 := nil;