Sfoglia il codice sorgente

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

git-svn-id: trunk@21681 -
pierre 13 anni fa
parent
commit
f2e83b0d7e
2 ha cambiato i file con 14 aggiunte e 8 eliminazioni
  1. 7 4
      ide/fpredir.pas
  2. 7 4
      ide/fputils.pas

+ 7 - 4
ide/fpredir.pas

@@ -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;

+ 7 - 4
ide/fputils.pas

@@ -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;