From f13c5fae059adf90c582712ef80bd1e1a4486619 Mon Sep 17 00:00:00 2001 From: Tomas Hajny Date: Sun, 2 Oct 2011 01:41:56 +0000 Subject: [PATCH] * additional fixes for ExecuteProcess - running of DOS programs in current directory and proper closing of the created queue git-svn-id: trunk@19323 - --- rtl/os2/sysutils.pp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/rtl/os2/sysutils.pp b/rtl/os2/sysutils.pp index b3c9409972..cee7d712d2 100644 --- a/rtl/os2/sysutils.pp +++ b/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);