Pārlūkot izejas kodu

also return nil for the empty env vars in the generic implementation in GetEnvPChar

git-svn-id: trunk@24733 -
Károly Balogh 12 gadi atpakaļ
vecāks
revīzija
76d7527909
1 mainītis faili ar 5 papildinājumiem un 0 dzēšanām
  1. 5 0
      compiler/globals.pas

+ 5 - 0
compiler/globals.pas

@@ -902,6 +902,11 @@ implementation
         {$undef GETENVOK}
       {$else}
         GetEnvPchar:=StrPNew(GetEnvironmentVariable(envname));
+        if (length(GetEnvPChar)=0) then 
+          begin
+            FreeEnvPChar(GetEnvPChar);
+            GetEnvPChar:=nil;
+          end;
       {$endif}
       end;