From e17132c10efa2439add7a8a0b72ec676600f50f3 Mon Sep 17 00:00:00 2001 From: Jan Dubois Date: Mon, 18 Dec 2006 08:34:33 -0800 Subject: [PATCH] Don't destroy the Unicode system environment on Perl startup Message-ID: p4raw-id: //depot/perl@29590 --- perl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/perl.c b/perl.c index 4ad77af..7d0aeb0 100644 --- a/perl.c +++ b/perl.c @@ -4653,6 +4653,7 @@ S_init_postdump_symbols(pTHX_ register int argc, register char **argv, register } if ((PL_envgv = gv_fetchpvs("ENV", GV_ADD|GV_NOTQUAL, SVt_PVHV))) { HV *hv; + bool env_is_not_environ; GvMULTI_on(PL_envgv); hv = GvHVn(PL_envgv); hv_magic(hv, NULL, PERL_MAGIC_env); @@ -4665,7 +4666,8 @@ S_init_postdump_symbols(pTHX_ register int argc, register char **argv, register */ if (!env) env = environ; - if (env != environ + env_is_not_environ = env != environ; + if (env_is_not_environ # ifdef USE_ITHREADS && PL_curinterp == aTHX # endif @@ -4687,7 +4689,7 @@ S_init_postdump_symbols(pTHX_ register int argc, register char **argv, register #endif sv = newSVpv(s+1, 0); (void)hv_store(hv, *env, s - *env, sv, 0); - if (env != environ) + if (env_is_not_environ) mg_set(sv); if (origenv != environ) { /* realloc has shifted us */ -- 2.7.4