Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix case of broken symlink
  • Loading branch information
lizmat committed Feb 26, 2015
1 parent 7d11343 commit 2eee799
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/core/IO.pm
Expand Up @@ -463,11 +463,13 @@ sub FILETEST-LDEVICE(Str $abspath) {
}

sub OBJECTIFY-ABSPATH(Str $abspath, :$check = True) {
FILETEST-f($abspath)
?? IO::File.new(:$abspath)
!! FILETEST-d($abspath)
?? IO::Dir.new(:abspath($abspath ~ '/'), :$check)
!! IO::Local.new(:$abspath);
FILETEST-e($abspath)
?? FILETEST-f($abspath)
?? IO::File.new(:$abspath)
!! FILETEST-d($abspath)
?? IO::Dir.new(:abspath($abspath ~ '/'), :$check)
!! IO::Local.new(:$abspath) # block device, unix socket, etc.
!! IO::Local.new(:$abspath); # broken symlink
}
sub DIR-GATHER(Str $abspath,Mu $test) {
gather {
Expand Down

0 comments on commit 2eee799

Please sign in to comment.