Browse Source

+ on windows, search %ALLUSERSPROFILE% and %USERPROFILE% for fpc.cfg

git-svn-id: trunk@19927 -
florian 13 years ago
parent
commit
2dc2d65b1a
1 changed files with 8 additions and 0 deletions
  1. 8 0
      compiler/options.pas

+ 8 - 0
compiler/options.pas

@@ -2416,6 +2416,14 @@ begin
       if CfgFileExists(configpath+fn) then
        foundfn:=configpath+fn
      else
+{$ifdef WINDOWS}
+       if (GetEnvironmentVariable('USERPROFILE')<>'') and CfgFileExists(FixPath(GetEnvironmentVariable('USERPROFILE'),false)+fn) then
+         foundfn:=FixPath(GetEnvironmentVariable('USERPROFILE'),false)+fn
+     else
+       if (GetEnvironmentVariable('ALLUSERSPROFILE')<>'') and CfgFileExists(FixPath(GetEnvironmentVariable('ALLUSERSPROFILE'),false)+fn) then
+         foundfn:=FixPath(GetEnvironmentVariable('ALLUSERSPROFILE'),false)+fn
+     else
+{$endif WINDOWS}
 {$ifndef Unix}
       if CfgFileExists(exepath+fn) then
        foundfn:=exepath+fn