diff options
author | Tomasz Konojacki <me@xenu.pl> | 2022-04-19 16:41:23 +0200 |
---|---|---|
committer | xenu <me@xenu.pl> | 2022-05-29 00:54:10 +0200 |
commit | 66673af5955ecc69305b0baad0a8fb6162312409 (patch) | |
tree | ff6230ba36209f14b77f4aa92dbaa563a829e2b8 | |
parent | 471430840e1f4a41f79744508c22d7569e6ed3f8 (diff) | |
download | perl-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.
-rw-r--r-- | embedvar.h | 1 | ||||
-rw-r--r-- | intrpvar.h | 1 | ||||
-rw-r--r-- | perl.c | 3 | ||||
-rw-r--r-- | perlvars.h | 1 | ||||
-rw-r--r-- | sv.c | 1 |
5 files changed, 3 insertions, 4 deletions
diff --git a/embedvar.h b/embedvar.h index 11989eb894..da874d457c 100644 --- a/embedvar.h +++ b/embedvar.h @@ -214,7 +214,6 @@ #define PL_origalen (vTHX->Iorigalen) #define PL_origargc (vTHX->Iorigargc) #define PL_origargv (vTHX->Iorigargv) -#define PL_origenviron (vTHX->Iorigenviron) #define PL_origfilename (vTHX->Iorigfilename) #define PL_ors_sv (vTHX->Iors_sv) #define PL_osname (vTHX->Iosname) diff --git a/intrpvar.h b/intrpvar.h index 94ddbf672b..2ff67a8e0f 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -700,7 +700,6 @@ PERLVARI(I, cop_seqmax, U32, PERL_COP_SEQMAX) /* statement sequence number */ PERLVARI(I, evalseq, U32, 0) /* eval sequence number */ PERLVAR(I, origalen, U32) -PERLVAR(I, origenviron, char **) #ifdef PERL_USES_PL_PIDSTATUS PERLVAR(I, pidstatus, HV *) /* pid-to-status mappings for waitpid */ #endif @@ -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 diff --git a/perlvars.h b/perlvars.h index 9a2c94f4c7..ae52cbe00c 100644 --- a/perlvars.h +++ b/perlvars.h @@ -303,3 +303,4 @@ PERLVARI(G, strategy_pipe, int, 0) /* doio.c */ PERLVARI(G, strategy_socketpair, int, 0) /* doio.c */ PERLVARI(G, my_environ, char **, NULL) +PERLVARI(G, origenviron, char **, NULL) @@ -15548,7 +15548,6 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags, PL_nomemok = proto_perl->Inomemok; PL_an = proto_perl->Ian; PL_evalseq = proto_perl->Ievalseq; - PL_origenviron = proto_perl->Iorigenviron; /* XXX not quite right */ PL_origalen = proto_perl->Iorigalen; PL_sighandlerp = proto_perl->Isighandlerp; |