From: Rafael Garcia-Suarez Date: Fri, 26 Dec 2008 12:11:28 +0000 (+0100) Subject: Revert "[perl #6665] Different behavior using the -Idir option on the command line... X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e7049783a827d931f30447582253605eb3b93210;p=p5sagit%2Fp5-mst-13.2.git Revert "[perl #6665] Different behavior using the -Idir option on the command line and inside a perl script" This reverts commit ccb8f6a64f3dd06b4360bc27c194b28e6766a6ad. --- diff --git a/perl.c b/perl.c index deb9d38..021f35d 100644 --- a/perl.c +++ b/perl.c @@ -4873,8 +4873,7 @@ S_incpush_if_exists(pTHX_ SV *dir) if (PerlLIO_stat(SvPVX_const(dir), &tmpstatbuf) >= 0 && S_ISDIR(tmpstatbuf.st_mode)) { - av_unshift( GvAVn( PL_incgv ), 1 ); - av_store( GvAVn( PL_incgv ), 0, dir ); + av_push(GvAVn(PL_incgv), dir); dir = newSV(0); } return dir; @@ -5094,9 +5093,8 @@ S_incpush(pTHX_ const char *dir, bool addsubdirs, bool addoldvers, bool usesep, #endif } - /* finally add this lib directory at the beginning of @INC */ - av_unshift( GvAVn( PL_incgv ), 1 ); - av_store( GvAVn( PL_incgv ), 0, libdir ); + /* finally push this lib directory on the end of @INC */ + av_push(GvAVn(PL_incgv), libdir); } if (subdir) { assert (SvREFCNT(subdir) == 1); diff --git a/t/run/switchI.t b/t/run/switchI.t index cfb0f6e..41192cd 100644 --- a/t/run/switchI.t +++ b/t/run/switchI.t @@ -15,11 +15,11 @@ my $Is_VMS = $^O eq 'VMS'; my $lib; $lib = $Is_MacOS ? ':Bla:' : 'Bla'; -ok(grep { $_ eq $lib } @INC[0..($#INC-1)]); +ok(grep { $_ eq $lib } @INC); SKIP: { skip 'Double colons not allowed in dir spec', 1 if $Is_VMS; $lib = $Is_MacOS ? 'Foo::Bar:' : 'Foo::Bar'; - ok(grep { $_ eq $lib } @INC[0..($#INC-1)]); + ok(grep { $_ eq $lib } @INC); } $lib = $Is_MacOS ? ':Bla2:' : 'Bla2';