summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtur Bergman <sky@nanisky.com>2001-09-26 05:58:35 +0000
committerArtur Bergman <sky@nanisky.com>2001-09-26 05:58:35 +0000
commit0631ea039330939c8d770bbc106391c8b0287539 (patch)
tree4c930f30fa7fa1462b140644a9a18ba087953f25
parent3d47000ed389c82b7bce6c0194372bdadfd5f96c (diff)
downloadperl-0631ea039330939c8d770bbc106391c8b0287539.tar.gz
Do the environ assignment in perl_contruct to match perl_destruct.
Now we don't need to perl_parse/perl_run. However environ is a global.... p4raw-id: //depot/perl@12222
-rw-r--r--perl.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/perl.c b/perl.c
index a497a39980..5f07bfc29d 100644
--- a/perl.c
+++ b/perl.c
@@ -284,6 +284,15 @@ perl_construct(pTHXx)
HvSHAREKEYS_off(PL_strtab); /* mandatory */
hv_ksplit(PL_strtab, 512);
+#if defined(__DYNAMIC__) && (defined(NeXT) || defined(__NeXT__))
+ _dyld_lookup_and_bind
+ ("__environ", (unsigned long *) &environ_pointer, NULL);
+#endif /* environ */
+
+#ifdef USE_ENVIRON_ARRAY
+ PL_origenviron = environ;
+#endif
+
ENTER;
}
@@ -462,6 +471,7 @@ perl_destruct(pTHXx)
for (i = 0; environ[i]; i++)
safesysfree(environ[i]);
+
/* Must use safesysfree() when working with environ. */
safesysfree(environ);
@@ -931,11 +941,6 @@ setuid perl scripts securely.\n");
#endif
#endif
-#if defined(__DYNAMIC__) && (defined(NeXT) || defined(__NeXT__))
- _dyld_lookup_and_bind
- ("__environ", (unsigned long *) &environ_pointer, NULL);
-#endif /* environ */
-
PL_origargc = argc;
{
/* we copy rather than point to argv
@@ -951,9 +956,7 @@ setuid perl scripts securely.\n");
}
}
-#ifdef USE_ENVIRON_ARRAY
- PL_origenviron = environ;
-#endif
+
if (PL_do_undump) {