In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/e63be7465b2d564165a64209685cfd7026a2005b?hp=15932acc618e3c642a4814dee6429b92b088b3fd>

- Log -----------------------------------------------------------------
commit e63be7465b2d564165a64209685cfd7026a2005b
Author: Rafael Garcia-Suarez <[email protected]>
Date:   Thu Jun 25 19:57:19 2009 +0200

    Trim all trailing / from "." in @INC when filling %INC
    
    This fixes bug #66942 : as a / was left in the directory name,
    $INC{"Foo.pm"} for a file loaded from the current directory
    was given the incorrect value "/Foo.pm".
-----------------------------------------------------------------------

Summary of changes:
 pp_ctl.c       |    6 ++++--
 t/run/runenv.t |   17 ++++++++++++++++-
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/pp_ctl.c b/pp_ctl.c
index a7f1b76..6bb5b40 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3489,8 +3489,10 @@ PP(pp_require)
                    tryname = SvPVX_const(namesv);
                    tryrsfp = doopen_pm(tryname, SvCUR(namesv));
                    if (tryrsfp) {
-                       if (tryname[0] == '.' && tryname[1] == '/')
-                           tryname += 2;
+                       if (tryname[0] == '.' && tryname[1] == '/') {
+                           ++tryname;
+                           while (*++tryname == '/');
+                       }
                        break;
                    }
                    else if (errno == EMFILE)
diff --git a/t/run/runenv.t b/t/run/runenv.t
index 03706ed..3628bd0 100644
--- a/t/run/runenv.t
+++ b/t/run/runenv.t
@@ -15,7 +15,7 @@ BEGIN {
     require './test.pl'
 }
 
-plan tests => 76;
+plan tests => 78;
 
 my $STDOUT = tempfile();
 my $STDERR = tempfile();
@@ -147,6 +147,21 @@ try({PERL5OPT => '-Mstrict -Mwarnings'},
     "ok",
     "");
 
+open F, ">", "Oooof.pm" or die "Can't write Oooof.pm: $!";
+print F "package Oooof; 1;\n";
+close F;
+END { 1 while unlink "Oooof.pm" }
+
+try({PERL5OPT => '-I. -MOooof'}, 
+    ['-e', 'print "ok" if $INC{"Oooof.pm"} eq "Oooof.pm"'],
+    "ok",
+    "");
+
+try({PERL5OPT => '-I./ -MOooof'}, 
+    ['-e', 'print "ok" if $INC{"Oooof.pm"} eq "Oooof.pm"'],
+    "ok",
+    "");
+
 try({PERL5OPT => '-w -w'},
     ['-e', 'print $ENV{PERL5OPT}'],
     '-w -w',

--
Perl5 Master Repository

Reply via email to