* cygcheck.cc (load_cygwin): Avoid calling putenv with a NULL path.
This commit is contained in:
parent
2c64ff5451
commit
41dcb6199c
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue