Browse Source

* getenv with envp=nil check

peter 27 years ago
parent
commit
f6e66549b8
1 changed files with 12 additions and 6 deletions
  1. 12 6
      rtl/linux/linux.pp

+ 12 - 6
rtl/linux/linux.pp

@@ -2364,12 +2364,15 @@ Begin
   p:=p+'=';            {Else HOST will also find HOSTNAME, etc}
   ep:=envp;
   found:=false;
-  while (not found) and (ep^<>nil) do
+  if ep<>nil then
    begin
-     if strlcomp(@p[1],(ep^),length(p))=0 then
-      found:=true
-     else
-      ep:=ep+4;
+     while (not found) and (ep^<>nil) do
+      begin
+        if strlcomp(@p[1],(ep^),length(p))=0 then
+         found:=true
+        else
+         ep:=ep+4;
+      end;
    end;
   if found then
    getenv:=ep^+length(p)
@@ -3510,7 +3513,10 @@ End.
 
 {
   $Log$
-  Revision 1.21  1998-10-15 08:31:11  peter
+  Revision 1.22  1998-10-23 00:05:32  peter
+    * getenv with envp=nil check
+
+  Revision 1.21  1998/10/15 08:31:11  peter
     * type aliases using delphi typenaming
 
   Revision 1.20  1998/10/11 12:23:11  michael