Pārlūkot izejas kodu

* don't add target_info.unit_env to the unit search path
if it's not set/empty

git-svn-id: trunk@8931 -

Jonas Maebe 18 gadi atpakaļ
vecāks
revīzija
81c5abfb72
1 mainītis faili ar 6 papildinājumiem un 1 dzēšanām
  1. 6 1
      compiler/options.pas

+ 6 - 1
compiler/options.pas

@@ -2079,6 +2079,7 @@ end;
 
 procedure read_arguments(cmd:string);
 var
+  env: ansistring;
   i : tfeature;
 begin
   option:=coption.create;
@@ -2344,7 +2345,11 @@ begin
   if inputfilepath<>'' then
    Unitsearchpath.AddPath(inputfilepath,true);
   if not disable_configfile then
-    UnitSearchPath.AddPath(GetEnvironmentVariable(target_info.unit_env),false);
+    begin
+      env:=GetEnvironmentVariable(target_info.unit_env);
+      if env<>'' then
+        UnitSearchPath.AddPath(GetEnvironmentVariable(target_info.unit_env),false);
+    end;
 
 {$ifdef Unix}
   fpcdir:=FixPath(GetEnvironmentVariable('FPCDIR'),false);