summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/environ.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/environ.cc')
-rw-r--r--winsup/cygwin/environ.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc
index b53600724..7c236df42 100644
--- a/winsup/cygwin/environ.cc
+++ b/winsup/cygwin/environ.cc
@@ -259,12 +259,13 @@ setenv (const char *name, const char *value, int rewrite)
extern "C" void
unsetenv (const char *name)
{
- register char **P;
+ register char **e;
int offset;
while (my_findenv (name, &offset)) /* if set multiple times */
- for (P = &environ[offset];; ++P)
- if (!(*P = *(P + 1)))
+ /* Move up the rest of the array */
+ for (e = environ + offset; ; e++)
+ if (!(*e = *(e + 1)))
break;
}