Przeglądaj źródła

* additional fixes for ExecuteProcess - running of DOS programs in current directory and proper closing of the created queue

git-svn-id: trunk@19323 -
Tomas Hajny 14 lat temu
rodzic
commit
f13c5fae05
1 zmienionych plików z 10 dodań i 2 usunięć
  1. 10 2
      rtl/os2/sysutils.pp

+ 10 - 2
rtl/os2/sysutils.pp

@@ -669,7 +669,13 @@ begin
  FillChar (SD, SizeOf (SD), 0);
  SD.Length := SizeOf (SD);
  SD.Related := ssf_Related_Child;
- SD.PgmName := PChar (Path);
+ if FileExists (Path) then
+(* Full path necessary for starting different executable files from current *)
+(* directory. *)
+  CommandLine := ExpandFileName (Path)
+ else
+  CommandLine := Path;
+ SD.PgmName := PChar (CommandLine);
  if ComLine <> '' then
   SD.PgmInputs := PChar (ComLine);
  SD.InheritOpt := ssf_InhertOpt_Parent;
@@ -694,7 +700,9 @@ begin
        DosCloseQueue (HQ);
        DosFreeMem (PCI);
        FreeMem (ObjNameBuf, ObjBufSize);
-      end;
+      end
+     else
+      DosCloseQueue (HQ);
     end
    else
     DosCloseQueue (HQ);