Skip to content

Commit

Permalink
load files outside of @inc when path is absolute
Browse files Browse the repository at this point in the history
  • Loading branch information
FROGGS committed Aug 17, 2014
1 parent cee242f commit 113076e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Perl5/ModuleLoader.pm
Expand Up @@ -41,12 +41,16 @@ class Perl5::ModuleLoader {
my %INC := $INC.FLATTENABLE_HASH() if nqp::defined($INC);
my @INC := %INC<Perl5>.FLATTENABLE_LIST() if %INC<Perl5>;
my %chosen;
my $path = $file.path if $file;
if self.candidates($module_name, :$file, :@INC)[0] -> $candi {
%chosen<pm> = ~$candi.path;
$candi.has-precomp ??
?? (%chosen<load> = %chosen<key> = %chosen<pm> ~ '.' ~ $candi.precomp-ext)
!! (%chosen<key> = %chosen<pm>)
}
elsif $file && ($path.is-absolute || $file ~~ / './' | '.\\' /) && $path.e { #'
%chosen<pm> = %chosen<key> = ~$path.absolute;
}
elsif $file && self.files($file, :@INC)[0] -> $candi {
%chosen<pm> = %chosen<key> = $candi<files>{$file};
}
Expand Down

0 comments on commit 113076e

Please sign in to comment.