* dll_init.cc (dll::init): Accommodate ill-behaved dlls who don't fill out

p.envptr.
This commit is contained in:
Christopher Faylor 2011-03-27 19:14:02 +00:00
parent 623f23351c
commit f3e3e0e7eb
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2011-03-27 Christopher Faylor <me.cygwin2011@cgf.cx>
* dll_init.cc (dll::init): Accommodate ill-behaved dlls who don't fill
out p.envptr.
2011-03-25 Corinna Vinschen <corinna@vinschen.de>
* mmap.cc (mmap64): Add a cheat to let a certain autoconf test succeed

View File

@ -76,7 +76,10 @@ dll::init ()
int ret = 1;
/* This should be a no-op. Why didn't we just import this variable? */
*(p.envptr) = __cygwin_environ;
if (!p.envptr)
p.envptr = &__cygwin_environ;
else
*(p.envptr) = __cygwin_environ;
/* Don't run constructors or the "main" if we've forked. */
if (!in_forkee)