summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorTomasz Konojacki <me@xenu.pl>2022-04-19 16:41:23 +0200
committerxenu <me@xenu.pl>2022-05-29 00:54:10 +0200
commit66673af5955ecc69305b0baad0a8fb6162312409 (patch)
treeff6230ba36209f14b77f4aa92dbaa563a829e2b8 /perl.c
parent471430840e1f4a41f79744508c22d7569e6ed3f8 (diff)
downloadperl-66673af5955ecc69305b0baad0a8fb6162312409.tar.gz
make PL_origenviron global
The purpose of PL_origenviron is to preserve the earliest known value of environ, which is a global. All interpreters should share it.
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/perl.c b/perl.c
index 9bd4b3ed26..b3e16c0eaf 100644
--- a/perl.c
+++ b/perl.c
@@ -360,7 +360,8 @@ perl_construct(pTHXx)
#ifndef PERL_MICRO
# ifdef USE_ENVIRON_ARRAY
- PL_origenviron = environ;
+ if (!PL_origenviron)
+ PL_origenviron = environ;
# endif
#endif