* environ.cc: Use new definition of "environ" throughout.

(environ_init): Explicitly initialize __cygwin_environ.
(cur_environ): New function.  Detects when user has updated their environment.
* exec.cc: Use 'environ' define throughout rather than __cygwin_environ.
* spawn.cc: Ditto.
* winsup.h: Declare cur_environ, main_environ, environ.
This commit is contained in:
Christopher Faylor
2000-07-16 20:06:11 +00:00
parent b4e59f5f14
commit 0763ee9d83
5 changed files with 42 additions and 17 deletions

View File

@ -412,7 +412,7 @@ spawn_guts (HANDLE hToken, const char * prog_arg, const char *const *argv,
else
{
one_line.add ("\"", 1);
for (0; p = strpbrk (a, "\"\\"); a = ++p)
for (; (p = strpbrk (a, "\"\\")); a = ++p)
{
one_line.add (a, p - a);
if (*p == '\\' || *p == '"')
@ -894,8 +894,7 @@ spawnl (int mode, const char *path, const char *arg0, ...)
va_end (args);
return _spawnve (NULL, mode, path, (char * const *) argv,
__cygwin_environ);
return _spawnve (NULL, mode, path, (char * const *) argv, environ);
}
extern "C"
@ -940,7 +939,7 @@ spawnlp (int mode, const char *path, const char *arg0, ...)
va_end (args);
return spawnvpe (mode, path, (char * const *) argv, __cygwin_environ);
return spawnvpe (mode, path, (char * const *) argv, environ);
}
extern "C"
@ -970,7 +969,7 @@ extern "C"
int
spawnv (int mode, const char *path, const char * const *argv)
{
return _spawnve (NULL, mode, path, argv, __cygwin_environ);
return _spawnve (NULL, mode, path, argv, environ);
}
extern "C"
@ -985,7 +984,7 @@ extern "C"
int
spawnvp (int mode, const char *path, const char * const *argv)
{
return spawnvpe (mode, path, argv, __cygwin_environ);
return spawnvpe (mode, path, argv, environ);
}
extern "C"