summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/spawn.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-07-16 20:06:11 +0000
committerChristopher Faylor <me@cgf.cx>2000-07-16 20:06:11 +0000
commit0763ee9d8324d1a0c1a26057e90719f21a13e826 (patch)
tree07a632e5bb42d0861cb409860f8014246229836f /winsup/cygwin/spawn.cc
parentb4e59f5f1419800d7a2248d3721a9db88e80d4d8 (diff)
downloadcygnal-0763ee9d8324d1a0c1a26057e90719f21a13e826.tar.gz
cygnal-0763ee9d8324d1a0c1a26057e90719f21a13e826.tar.bz2
cygnal-0763ee9d8324d1a0c1a26057e90719f21a13e826.zip
* 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.
Diffstat (limited to 'winsup/cygwin/spawn.cc')
-rw-r--r--winsup/cygwin/spawn.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index af284f8ee..ca22436fd 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -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"