Explorar o código

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

git-svn-id: trunk@24733 -
Károly Balogh %!s(int64=12) %!d(string=hai) anos
pai
achega
76d7527909
Modificáronse 1 ficheiros con 5 adicións e 0 borrados
  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;