Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2000-07-12 08:02:45 +0400
committerChristopher Faylor <me@cgf.cx>2000-07-12 08:02:45 +0400
commita0f7b496ad87e70720c6a1bef0e31b0524444d21 (patch)
tree09438e82069d5a5f3cede456328cb43234a6efd2 /winsup/cygwin/lib
parent1ff7263eb9448707e6571aaa3c5ab33caf78332a (diff)
* lib/_cygwin_crt0_common.cc (_cygwin_crt0_common): Don't reset environ if
already set.
Diffstat (limited to 'winsup/cygwin/lib')
-rw-r--r--winsup/cygwin/lib/_cygwin_crt0_common.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/winsup/cygwin/lib/_cygwin_crt0_common.cc b/winsup/cygwin/lib/_cygwin_crt0_common.cc
index 4ca6dd74e..fcca1694f 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