diff options
author | Christopher Faylor <me@cgf.cx> | 2000-09-25 16:36:12 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2000-09-25 16:36:12 +0000 |
commit | fb5956da13ac60a3408632efd62e685458899924 (patch) | |
tree | 99cdd3b9367da6786298104991ee5750fc08b5e1 /winsup/cygwin/environ.cc | |
parent | eb69b80812d1b8e7d95b9e5abc95a0a839df13ed (diff) | |
download | cygnal-fb5956da13ac60a3408632efd62e685458899924.tar.gz cygnal-fb5956da13ac60a3408632efd62e685458899924.tar.bz2 cygnal-fb5956da13ac60a3408632efd62e685458899924.zip |
* spawn.cc (av::dup_maybe): Make function void rather than void *.
* environ.cc (environ_init): Remember to reparse CYGWIN if envp is
supplied.
* heap.cc (_sbrk): Remember frame for signal handling.
* syscalls.cc (read_handler): Eliminate.
(_read): Move read_handler code here. Reorganize for one path through
'ready_for_read'.
Diffstat (limited to 'winsup/cygwin/environ.cc')
-rw-r--r-- | winsup/cygwin/environ.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc index 9c7b72ce0..f0a3fc7d7 100644 --- a/winsup/cygwin/environ.cc +++ b/winsup/cygwin/environ.cc @@ -524,6 +524,7 @@ environ_init (char **envp) char *p; char *newp; int sawTERM = 0; + bool envp_passed_in; static char cygterm[] = "TERM=cygwin"; regopt ("default"); @@ -536,13 +537,16 @@ environ_init (char **envp) allow_ntsec = TRUE; #endif - if (envp) + if (!envp) + envp_passed_in = 0; + else { sz = envsize (envp, 1); char **newenv = (char **) malloc (sz); memcpy (newenv, envp, sz); cfree (envp); envp = newenv; + envp_passed_in = 1; goto out; } @@ -585,6 +589,12 @@ environ_init (char **envp) out: __cygwin_environ = envp; update_envptrs (); + if (envp_passed_in) + { + p = getenv ("CYGWIN"); + if (p) + parse_options (p); + } parse_options (NULL); MALLOC_CHECK; } |