From: Nicholas Clark Date: Sun, 22 Feb 2009 21:11:19 +0000 (+0100) Subject: In S_incpush, move the declaration of subdir inside the only block that uses it. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=10cc20f60c359ae5d3303fc24a4918518974bc83;p=p5sagit%2Fp5-mst-13.2.git In S_incpush, move the declaration of subdir inside the only block that uses it. --- diff --git a/perl.c b/perl.c index f489c5b..60f8538 100644 --- a/perl.c +++ b/perl.c @@ -4355,7 +4355,6 @@ S_incpush(pTHX_ const char *const dir, STRLEN len, U32 flags) const U8 canrelocate = (U8)flags & INCPUSH_CAN_RELOCATE; const U8 unshift = (U8)flags & INCPUSH_UNSHIFT; const U8 push_basedir = (flags & INCPUSH_NOT_BASEDIR) ? 0 : 1; - SV *subdir = NULL; AV *inc; if (!dir || !*dir) @@ -4363,10 +4362,6 @@ S_incpush(pTHX_ const char *const dir, STRLEN len, U32 flags) inc = GvAVn(PL_incgv); - if (using_sub_dirs) { - subdir = newSV(0); - } - { SV *libdir; /* Change 20189146be79a0596543441fa369c6bf7f85103f, to fix RT#6665, @@ -4503,6 +4498,7 @@ S_incpush(pTHX_ const char *const dir, STRLEN len, U32 flags) * archname-specific sub-directories. */ if (using_sub_dirs) { + SV *subdir = newSV(0); #ifdef PERL_INC_VERSION_LIST /* Configure terminates PERL_INC_VERSION_LIST with a NULL */ const char * const incverlist[] = { PERL_INC_VERSION_LIST }; @@ -4512,6 +4508,7 @@ S_incpush(pTHX_ const char *const dir, STRLEN len, U32 flags) char *unix; STRLEN len; + if ((unix = tounixspec_ts(SvPV(libdir,len),NULL)) != NULL) { len = strlen(unix); while (unix[len-1] == '/') len--; /* Cosmetic */ @@ -4564,6 +4561,9 @@ S_incpush(pTHX_ const char *const dir, STRLEN len, U32 flags) subdir = S_incpush_if_exists(aTHX_ av, subdir); } + + assert (SvREFCNT(subdir) == 1); + SvREFCNT_dec(subdir); } /* finally add this lib directory at the end of @INC */ @@ -4596,10 +4596,6 @@ S_incpush(pTHX_ const char *const dir, STRLEN len, U32 flags) SvREFCNT_dec(libdir); } } - if (subdir) { - assert (SvREFCNT(subdir) == 1); - SvREFCNT_dec(subdir); - } } STATIC void