From f2e83b0d7e5260218612a36bc72e007efe52a513 Mon Sep 17 00:00:00 2001 From: pierre Date: Fri, 22 Jun 2012 19:03:13 +0000 Subject: [PATCH] * Avoid ShortString limitations for LocateExeFile in PATH environment variable is very long git-svn-id: trunk@21681 - --- ide/fpredir.pas | 11 +++++++---- ide/fputils.pas | 11 +++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/ide/fpredir.pas b/ide/fpredir.pas index a553911d33..66f8a569ba 100644 --- a/ide/fpredir.pas +++ b/ide/fpredir.pas @@ -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; diff --git a/ide/fputils.pas b/ide/fputils.pas index 1000e86570..25f89a2966 100644 --- a/ide/fputils.pas +++ b/ide/fputils.pas @@ -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;