diff options
author | Nicholas Clark <nick@ccl4.org> | 2009-02-22 22:11:19 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2009-02-22 22:11:19 +0100 |
commit | 10cc20f60c359ae5d3303fc24a4918518974bc83 (patch) | |
tree | c6b981844d11d86947f959a26d0d8c154fe75ec1 /perl.c | |
parent | be71fc8f6462a4d4d8401865d1ad320d5c97f590 (diff) | |
download | perl-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.c | 14 |
1 files changed, 5 insertions, 9 deletions
@@ -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 |