diff options
author | Christopher Faylor <me@cgf.cx> | 2000-07-12 04:02:45 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2000-07-12 04:02:45 +0000 |
commit | a0f7b496ad87e70720c6a1bef0e31b0524444d21 (patch) | |
tree | 09438e82069d5a5f3cede456328cb43234a6efd2 /winsup/cygwin | |
parent | 1ff7263eb9448707e6571aaa3c5ab33caf78332a (diff) | |
download | newlib-a0f7b496ad87e70720c6a1bef0e31b0524444d21.zip newlib-a0f7b496ad87e70720c6a1bef0e31b0524444d21.tar.gz newlib-a0f7b496ad87e70720c6a1bef0e31b0524444d21.tar.bz2 |
* lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Don't reset environ if
already set.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/dcrt0.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/lib/_cygwin_crt0_common.cc | 5 |
3 files changed, 10 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index c509ceb..05c2223 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +Wed Jul 12 00:01:03 2000 Christopher Faylor <cgf@cygnus.com> + + * lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Don't reset + environ if already set. + Mon Jul 10 19:07:03 2000 Christopher Faylor <cgf@cygnus.com> * fhandler_console.cc (fhandler_console::read): Unicode interface diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index 854739e..a42e84e 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -71,7 +71,7 @@ extern "C" {/* initial_sp */ 0, /* magic_biscuit */ 0, /* dll_major */ CYGWIN_VERSION_DLL_MAJOR, /* dll_major */ CYGWIN_VERSION_DLL_MINOR, - /* impure_ptr_ptr */ NULL, /*envptr */ NULL, + /* impure_ptr_ptr */ NULL, /* envptr */ NULL, /* malloc */ export_malloc, /* free */ export_free, /* realloc */ export_realloc, /* fmode_ptr */ NULL, /* main */ NULL, /* ctors */ NULL, diff --git a/winsup/cygwin/lib/_cygwin_crt0_common.cc b/winsup/cygwin/lib/_cygwin_crt0_common.cc index 4ca6dd7..fcca169 100644 --- a/winsup/cygwin/lib/_cygwin_crt0_common.cc +++ b/winsup/cygwin/lib/_cygwin_crt0_common.cc @@ -56,7 +56,10 @@ _cygwin_crt0_common (MainFunc f, per_process *u) u->ctors = &__CTOR_LIST__; u->dtors = &__DTOR_LIST__; - u->envptr = &environ; + if (!u->envptr) + u->envptr = &environ; + else + environ = *(u->envptr); if (uwasnull) _impure_ptr = u->impure_ptr; /* Use field initialized in newer DLLs. */ else |