From 0385b4dad742388f20b4041edef61c1b89253cc9 Mon Sep 17 00:00:00 2001 From: Almindor Date: Sun, 17 Dec 2006 10:31:59 +0000 Subject: [PATCH] * fix 5599 (wrong logic in existance determination) git-svn-id: trunk@5617 - --- fcl/unix/process.inc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fcl/unix/process.inc b/fcl/unix/process.inc index ff5fc2e667..e417abd410 100644 --- a/fcl/unix/process.inc +++ b/fcl/unix/process.inc @@ -270,12 +270,17 @@ begin If (PName='') then PName:=CommandLine; end; - if (pos('/',PName)<>1) then - P2:=FileSearch(Pname,fpgetenv('PATH')); + + if not FileExists(PName) then + P2 := FileSearch(Pname,fpgetenv('PATH')) + else + P2 := PName; + If (P2='') then Raise EProcess.CreateFmt(SErrNoSuchProgram,[PName]) else PName:=P2; + Pid:=fpfork; if Pid<0 then Raise EProcess.Create('Failed to Fork process');