projects
/
p5sagit/p5-mst-13.2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
401441c
)
Patch for perl.c fixing an obscure environment bug
Merijn Broeren [Thu, 23 Sep 2004 17:18:17 +0000 (19:18 +0200)]
Message-ID: <
20040923151817
.GA15782@brugman.iloquent.nl>
p4raw-id: //depot/perl@23337
perl.c
patch
|
blob
|
blame
|
history
diff --git
a/perl.c
b/perl.c
index
957bbbc
..
41c538a
100644
(file)
--- a/
perl.c
+++ b/
perl.c
@@
-4097,9
+4097,10
@@
S_init_postdump_symbols(pTHX_ register int argc, register char **argv, register
{
environ[0] = Nullch;
}
- if (env)
+ if (env) {
+ char** origenv = environ;
for (; *env; env++) {
- if (!(s = strchr(*env,'=')))
+ if (!(s = strchr(*env,'=')) || s == *env)
continue;
#if defined(MSDOS) && !defined(DJGPP)
*s = '\0';
@@
-4110,7
+4111,13
@@
S_init_postdump_symbols(pTHX_ register int argc, register char **argv, register
(void)hv_store(hv, *env, s - *env, sv, 0);
if (env != environ)
mg_set(sv);
+ if (origenv != environ) {
+ /* realloc has shifted us */
+ env = (env - origenv) + environ;
+ origenv = environ;
+ }
}
+ }
#endif /* USE_ENVIRON_ARRAY */
#endif /* !PERL_MICRO */
}