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

View File

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