This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
59d6f6a4c05afa7f was too aggressive, as it disabled #! line -I on miniperl
authorNicholas Clark <nick@ccl4.org>
Sat, 5 Mar 2011 19:59:42 +0000 (19:59 +0000)
committerNicholas Clark <nick@ccl4.org>
Sat, 5 Mar 2011 20:18:17 +0000 (20:18 +0000)
Restore -I processing on the #! line for miniperl. This gets t/run/switchI.t
and t/run/switchd-78586.t passing again under minitest.

perl.c

diff --git a/perl.c b/perl.c
index dd557af..5efa8e5 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -4592,11 +4592,15 @@ S_incpush(pTHX_ const char *const dir, STRLEN len, U32 flags)
 #endif /* !PERL_IS_MINIPERL */
        /* finally add this lib directory at the end of @INC */
        if (unshift) {
-#ifndef PERL_IS_MINIPERL
+#ifdef PERL_IS_MINIPERL
+           const U32 extra = 0;
+#else
            U32 extra = av_len(av) + 1;
+#endif
            av_unshift(inc, extra + push_basedir);
            if (push_basedir)
                av_store(inc, extra, libdir);
+#ifndef PERL_IS_MINIPERL
            while (extra--) {
                /* av owns a reference, av_store() expects to be donated a
                   reference, and av expects to be sane when it's cleared.