* fix executable not found exception

git-svn-id: trunk@9239 -
This commit is contained in:
peter 2007-11-13 19:23:34 +00:00
parent 80008b5146
commit e07b0ee147

View File

@ -248,6 +248,7 @@ Var
FEnv : PPChar;
Argv : PPChar;
fd : Integer;
FoundName,
PName : String;
begin
@ -272,9 +273,10 @@ begin
end;
if not FileExists(PName) then begin
PName := FileSearch(Pname,fpgetenv('PATH'));
if Length(PName) = 0 then
FoundName := FileSearch(Pname,fpgetenv('PATH'));
if FoundName<>'' then
PName:=FoundName
else
raise EProcess.CreateFmt(SErrNoSuchProgram,[PName]);
end;