2
0
Эх сурвалжийг харах

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

git-svn-id: trunk@24733 -
Károly Balogh 12 жил өмнө
parent
commit
76d7527909
1 өөрчлөгдсөн 5 нэмэгдсэн , 0 устгасан
  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;