From 816005240f1a3b9989c940e630e829048597537c Mon Sep 17 00:00:00 2001 From: "Craig A. Berry" Date: Fri, 4 Mar 2011 16:44:24 -0600 Subject: In S_incpush, unixify libdir earlier. This allows, for example, -I[.lib] to have Unix format appendages added, such as "/buildcustomize.pl", "/sitecustomize.pl", etc. It was previously only being converted to Unix syntax to allow the addition of subdirectories, but the number of things that want to glue pieces onto lib/ have multiplied over the years. --- perl.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/perl.c b/perl.c index 491c036260..127c2d4439 100644 --- a/perl.c +++ b/perl.c @@ -4429,6 +4429,21 @@ S_incpush(pTHX_ const char *const dir, STRLEN len, U32 flags) libdir = newSVpv(PERLLIB_MANGLE(dir, 0), 0); } +#ifdef VMS + char *unix; + STRLEN len; + + if ((unix = tounixspec_ts(SvPV(libdir,len),NULL)) != NULL) { + len = strlen(unix); + while (unix[len-1] == '/') len--; /* Cosmetic */ + sv_usepvn(libdir,unix,len); + } + else + PerlIO_printf(Perl_error_log, + "Failed to unixify @INC element \"%s\"\n", + SvPV(libdir,len)); +#endif + /* Do the if() outside the #ifdef to avoid warnings about an unused parameter. */ if (canrelocate) { @@ -4539,22 +4554,6 @@ S_incpush(pTHX_ const char *const dir, STRLEN len, U32 flags) const char * const incverlist[] = { PERL_INC_VERSION_LIST }; const char * const *incver; #endif -#ifdef VMS - char *unix; - STRLEN len; - - - if ((unix = tounixspec_ts(SvPV(libdir,len),NULL)) != NULL) { - len = strlen(unix); - while (unix[len-1] == '/') len--; /* Cosmetic */ - sv_usepvn(libdir,unix,len); - } - else - PerlIO_printf(Perl_error_log, - "Failed to unixify @INC element \"%s\"\n", - SvPV(libdir,len)); -#endif - subdir = newSVsv(libdir); if (add_versioned_sub_dirs) { -- cgit v1.2.1