summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-02-15 21:53:50 +0000
committerNicholas Clark <nick@ccl4.org>2009-02-15 21:53:50 +0000
commit4705144da61264103889bac66eba6d2d56a1da9d (patch)
tree93c66052922cc80fb9bf3e5576e562dda0537a99 /perl.c
parentb9ba2fadb18b54e35e5de54f945111a56cbcb249 (diff)
downloadperl-4705144da61264103889bac66eba6d2d56a1da9d.tar.gz
Ensure that the pointer to S_incpush_use_sep() is never NULL.
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/perl.c b/perl.c
index a308cf3580..9e52c981fe 100644
--- a/perl.c
+++ b/perl.c
@@ -4110,8 +4110,11 @@ S_init_perllib(pTHX_ U32 old_vers)
if (s)
#endif
incpush_use_sep(s, old_vers ? old_vers : INCPUSH_ADD_SUB_DIRS);
- else if (!old_vers)
- incpush_use_sep(PerlEnv_getenv("PERLLIB"), 0);
+ else if (!old_vers) {
+ s = PerlEnv_getenv("PERLLIB");
+ if (s)
+ incpush_use_sep(s, 0);
+ }
#else /* VMS */
/* Treat PERL5?LIB as a possible search list logical name -- the
* "natural" VMS idiom for a Unix path string. We allow each
@@ -4542,8 +4545,10 @@ S_incpush_use_sep(pTHX_ const char *p, U32 flags)
/* This logic has been broken out from S_incpush(). It may be possible to
simplify it. */
+ PERL_ARGS_ASSERT_INCPUSH_USE_SEP;
+
/* Break at all separators */
- while (p && *p) {
+ while (*p) {
const char *s;
/* skip any consecutive separators */