about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2000-08-25 13:30:57 +0000
committerAndreas Jaeger <aj@suse.de>2000-08-25 13:30:57 +0000
commitf157b53cbf1e21d419321048d5930d77207fac62 (patch)
treec7a3d2ea9077485aa4f8803c07e2a9791562b91f
parent5721d8dadb972bc3cb40e2009b952499f6a03d83 (diff)
downloadglibc-f157b53cbf1e21d419321048d5930d77207fac62.tar.gz
glibc-f157b53cbf1e21d419321048d5930d77207fac62.tar.xz
glibc-f157b53cbf1e21d419321048d5930d77207fac62.zip
* sysdeps/generic/dl-environ.c (unsetenv): Follow change to the
	real unsetenv implementation from 1999-07-29 [PR libc/1714].
-rw-r--r--sysdeps/generic/dl-environ.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sysdeps/generic/dl-environ.c b/sysdeps/generic/dl-environ.c
index 433102757c..19637917a5 100644
--- a/sysdeps/generic/dl-environ.c
+++ b/sysdeps/generic/dl-environ.c
@@ -1,5 +1,5 @@
-/*Environment handling for dynamic loader.
-   Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Environment handling for dynamic loader.
+   Copyright (C) 1995, 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -55,7 +55,8 @@ unsetenv (const char *name)
   const size_t len = strlen (name);
   char **ep;
 
-  for (ep = _environ; *ep != NULL; ++ep)
+  ep = _environ;
+  while (*ep != NULL)
     if (!strncmp (*ep, name, len) && (*ep)[len] == '=')
       {
 	/* Found it.  Remove this pointer by moving later ones back.  */
@@ -66,4 +67,6 @@ unsetenv (const char *name)
 	while (*dp++);
 	/* Continue the loop in case NAME appears again.  */
       }
+    else
+      ++ep;
 }