From 88f5bc07adcbdcc8427eef58d88a43884ef3f99a Mon Sep 17 00:00:00 2001 From: Alan Burlison Date: Tue, 11 Oct 2005 17:29:54 +0100 Subject: environ fixup Message-ID: <434BDA72.4090109@sun.com> p4raw-id: //depot/perl@25737 --- perl.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'perl.c') 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); -- cgit v1.2.1