summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorAlan Burlison <Alan.Burlison@uk.sun.com>2005-10-11 17:29:54 +0100
committerH.Merijn Brand <h.m.brand@xs4all.nl>2005-10-11 15:15:37 +0000
commit88f5bc07adcbdcc8427eef58d88a43884ef3f99a (patch)
tree9ff4104992b1e0501742f6532393057cfd7be2de /perl.c
parentd32793394506cce30e5ae4fb6827bb6a2d170dd1 (diff)
downloadperl-88f5bc07adcbdcc8427eef58d88a43884ef3f99a.tar.gz
environ fixup
Message-ID: <434BDA72.4090109@sun.com> p4raw-id: //depot/perl@25737
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/perl.c b/perl.c
index bc1f6529fa..72289a2f8a 100644
--- a/perl.c
+++ b/perl.c
@@ -4592,7 +4592,16 @@ S_init_perllib(pTHX)
if (!PL_tainting) {
#ifndef VMS
s = PerlEnv_getenv("PERL5LIB");
+/*
+ * It isn't possible to delete an environment variable with
+ * PERL_USE_SAFE_PUTENV set unless setenv() is also available, so in that case
+ * we treat PERL5LIB as undefined if it has a zero-length value.
+ */
+#if defined(PERL_USE_SAFE_PUTENV) && ! defined(HAS_UNSETENV)
+ if (s && *s != '\0')
+#else
if (s)
+#endif
incpush(s, TRUE, TRUE, TRUE, FALSE);
else
incpush(PerlEnv_getenv("PERLLIB"), FALSE, FALSE, TRUE, FALSE);