Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-05-16 07:18:29 +0400
committerChristopher Faylor <me@cgf.cx>2005-05-16 07:18:29 +0400
commit41dcb6199c7c905ae3bcfc8ffa6c3c3310435818 (patch)
treea4b066a345efbdfe26c6cf732ece841717efe411 /winsup/utils
parent2c64ff5451a37b403fbb14d7d88784c2276f3b56 (diff)
* cygcheck.cc (load_cygwin): Avoid calling putenv with a NULL path.
Diffstat (limited to 'winsup/utils')
-rw-r--r--winsup/utils/ChangeLog4
-rw-r--r--winsup/utils/cygcheck.cc7
2 files changed, 9 insertions, 2 deletions
diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog
index 43f374a63..fbe06db77 100644
--- a/winsup/utils/ChangeLog
+++ b/winsup/utils/ChangeLog
@@ -1,3 +1,7 @@
+2005-05-15 Christopher Faylor <cgf@timesys.com>
+
+ * cygcheck.cc (load_cygwin): Avoid calling putenv with a NULL path.
+
2005-05-15 Corinna Vinschen <corinna@vinschen.de>
* cygcheck.cc (load_cygwin): Don't touch $PATH for now.
diff --git a/winsup/utils/cygcheck.cc b/winsup/utils/cygcheck.cc
index afd43175c..fc334cee8 100644
--- a/winsup/utils/cygcheck.cc
+++ b/winsup/utils/cygcheck.cc
@@ -1466,12 +1466,15 @@ load_cygwin (int& argc, char **&argv)
char *path = NULL;
while (*_environ)
{
- if (!strncmp (*_environ, "PATH=", 5))
+ if (strncmp (*_environ, "PATH=", 5) == 0)
path = strdup (*_environ);
nuke (*_environ);
}
for (char **ev = envp; *ev; ev++)
- putenv (!strncmp (*ev, "PATH=", 5) ? path : *ev);
+ if (strncmp (*ev, "PATH=", 5) != 0)
+ putenv (*ev);
+ else if (path)
+ putenv (path);
}
}