In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/a651dcdf6a9151150dcf0fb6b18849d3e39b0811?hp=e0e5a3b035deab2c400406a77f3490125d9d8678>
- Log ----------------------------------------------------------------- commit a651dcdf6a9151150dcf0fb6b18849d3e39b0811 Author: Father Chrysostomos <spr...@cpan.org> Date: Mon Jul 4 08:48:57 2016 -0700 Fix XSLoader to recognize drive letters Commit 08e3451d made XSLoader confirm that the file path it got from (caller)[2] was in @INC if it looked like a relative path. Not taking drive letters into account, it made that @INC search mandatory on Windows and some other systems. It still worked, but was slightly slower. ----------------------------------------------------------------------- Summary of changes: dist/XSLoader/XSLoader_pm.PL | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/dist/XSLoader/XSLoader_pm.PL b/dist/XSLoader/XSLoader_pm.PL index 7e24b83..2efb99e 100644 --- a/dist/XSLoader/XSLoader_pm.PL +++ b/dist/XSLoader/XSLoader_pm.PL @@ -91,8 +91,20 @@ print OUT <<'EOT'; my $modpname = join('/',@modparts); my $c = () = split(/::/,$caller,-1); $modlibname =~ s,[\\/][^\\/]+$,, while $c--; # Q&D basename +EOT + +my $to_print = <<'EOT'; # Does this look like a relative path? - if ($modlibname !~ m|^[\\/]|) { + if ($modlibname !~ m{regexp}) { +EOT + +$to_print =~ s~regexp~ + $^O eq 'MSWin32' || $^O eq 'os2' || $^O eq 'cygwin' || $^O eq 'amigaos' + ? '^(?:[A-Za-z]:)?[\\\/]' # Optional drive letter + : '^/' +~e; + +print OUT $to_print, <<'EOT'; # Someone may have a #line directive that changes the file name, or # may be calling XSLoader::load from inside a string eval. We cer- # tainly do not want to go loading some code that is not in @INC, -- Perl5 Master Repository