This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In S_incpush, unixify libdir earlier.
authorCraig A. Berry <craigberry@mac.com>
Fri, 4 Mar 2011 22:44:24 +0000 (16:44 -0600)
committerCraig A. Berry <craigberry@mac.com>
Fri, 4 Mar 2011 22:44:24 +0000 (16:44 -0600)
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

diff --git a/perl.c b/perl.c
index 491c036..127c2d4 100644 (file)
--- 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) {