* Avoid ShortString limitations for LocateExeFile in PATH environment variable is very long

git-svn-id: trunk@21681 -
This commit is contained in:
pierre 2012-06-22 19:03:13 +00:00
parent d953783a7e
commit f2e83b0d7e
2 changed files with 14 additions and 8 deletions

View File

@ -79,6 +79,7 @@ const
Implementation Implementation
Uses Uses
sysutils,
{$ifdef go32v2} {$ifdef go32v2}
go32, go32,
{$endif go32v2} {$endif go32v2}
@ -280,7 +281,8 @@ end;
function LocateExeFile(var FileName:string): boolean; function LocateExeFile(var FileName:string): boolean;
var var
dir,s,d,n,e : string; S : AnsiString;
dir,d,n,e : string;
i : longint; i : longint;
begin begin
LocateExeFile:=False; LocateExeFile:=False;
@ -299,7 +301,7 @@ begin
Exit; Exit;
end; end;
S:=GetEnv('PATH'); S:=sysutils.GetEnvironmentVariable('PATH');
While Length(S)>0 do While Length(S)>0 do
begin begin
i:=1; i:=1;
@ -637,7 +639,8 @@ end;
function LocateExeFile(var FileName:string): boolean; function LocateExeFile(var FileName:string): boolean;
var var
dir,s,d,n,e : string; S : AnsiString;
dir,d,n,e : string;
i : longint; i : longint;
begin begin
LocateExeFile:=False; LocateExeFile:=False;
@ -656,7 +659,7 @@ begin
Exit; Exit;
end; end;
S:=GetEnv('PATH'); S:=sysutils.GetEnvironmentVariable('PATH');
While Length(S)>0 do While Length(S)>0 do
begin begin
i:=1; i:=1;

View File

@ -16,11 +16,13 @@ unit FPUtils;
interface interface
uses Objects; uses
Sysutils,
Objects;
const const
dirsep = System.DirectorySeparator; dirsep = System.DirectorySeparator;
{$ifdef Unix} {$ifdef Unix}
listsep = [';',':']; listsep = [';',':'];
exeext = ''; exeext = '';
@ -419,7 +421,8 @@ end;
function LocateExeFile(var FileName:string): boolean; function LocateExeFile(var FileName:string): boolean;
var var
dir,s : string; dir : string;
s : ansistring;
i : longint; i : longint;
begin begin
LocateExeFile:=False; LocateExeFile:=False;
@ -429,7 +432,7 @@ begin
Exit; Exit;
end; end;
S:=GetEnv('PATH'); S:=sysutils.GetEnvironmentVariable('PATH');
While Length(S)>0 do While Length(S)>0 do
begin begin
i:=1; i:=1;