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

git-svn-id: trunk@19927 -
This commit is contained in:
florian 2011-12-30 16:20:27 +00:00
parent 930883edf6
commit 2dc2d65b1a

View File

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