In S_incpush(), move push @INC, ".../$archname" if -d ".../$archname"; later.
Nicholas Clark [Sun, 22 Feb 2009 19:24:49 +0000 (20:24 +0100)]
This effects this change:

--- Start       2009-02-21 14:04:40.000000000 +0100
+++ /dev/fd/63  2009-02-22 16:41:18.000000000 +0100
@@ -1,14 +1,14 @@
 /Users/nick/Sandpit/511v/hashbangI/5.11.0/darwin-thread-multi-64int-2level
 /Users/nick/Sandpit/511v/hashbangI/5.11.0
-/Users/nick/Sandpit/511v/hashbangI/darwin-thread-multi-64int-2level
 /Users/nick/Sandpit/511v/hashbangI/5.11.-2/darwin-thread-multi-64int-2level
 /Users/nick/Sandpit/511v/hashbangI/5.11.-2
+/Users/nick/Sandpit/511v/hashbangI/darwin-thread-multi-64int-2level
 /Users/nick/Sandpit/511v/hashbangI
 /Users/nick/Sandpit/511v/cliI/5.11.0/darwin-thread-multi-64int-2level
 /Users/nick/Sandpit/511v/cliI/5.11.0
-/Users/nick/Sandpit/511v/cliI/darwin-thread-multi-64int-2level
 /Users/nick/Sandpit/511v/cliI/5.11.-1/darwin-thread-multi-64int-2level
 /Users/nick/Sandpit/511v/cliI/5.11.-1
+/Users/nick/Sandpit/511v/cliI/darwin-thread-multi-64int-2level
 /Users/nick/Sandpit/511v/cliI
 /Users/nick/Sandpit/511v/perl5lib0/5.11.0/darwin-thread-multi-64int-2level
 /Users/nick/Sandpit/511v/perl5lib0/5.11.0

perl.c

diff --git a/perl.c b/perl.c
index 0b03e41..02d06b9 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -4532,13 +4532,6 @@ S_incpush(pTHX_ const char *const dir, STRLEN len, U32 flags)
                sv_setsv(subdir, libdir);
                sv_catpvs(subdir, PERL_ARCH_FMT_PATH);
                subdir = S_incpush_if_exists(aTHX_ av, subdir);
-
-               /* .../archname if -d .../archname */
-               sv_setsv(subdir, libdir);
-               sv_catpvs(subdir,
-                         PERL_ARCH_FMT_PREFIX ARCHNAME PERL_ARCH_FMT_SUFFIX);
-               subdir = S_incpush_if_exists(aTHX_ av, subdir);
-
            }
 
 #ifdef PERL_INC_VERSION_LIST
@@ -4552,6 +4545,15 @@ S_incpush(pTHX_ const char *const dir, STRLEN len, U32 flags)
                }
            }
 #endif
+
+           if (addsubdirs) {
+               /* .../archname if -d .../archname */
+               sv_setsv(subdir, libdir);
+               sv_catpvs(subdir,
+                         PERL_ARCH_FMT_PREFIX ARCHNAME PERL_ARCH_FMT_SUFFIX);
+               subdir = S_incpush_if_exists(aTHX_ av, subdir);
+
+           }
        }
 
        /* finally add this lib directory at the end of @INC */