summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-02-22 22:11:19 +0100
committerNicholas Clark <nick@ccl4.org>2009-02-22 22:11:19 +0100
commit10cc20f60c359ae5d3303fc24a4918518974bc83 (patch)
treec6b981844d11d86947f959a26d0d8c154fe75ec1 /perl.c
parentbe71fc8f6462a4d4d8401865d1ad320d5c97f590 (diff)
downloadperl-10cc20f60c359ae5d3303fc24a4918518974bc83.tar.gz
In S_incpush, move the declaration of subdir inside the only block that uses it.
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/perl.c b/perl.c
index f489c5bb88..60f8538e45 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