Skip to content

Commit

Permalink
Fix for #126935
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Dec 17, 2015
1 parent b422f44 commit 8d50dab
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/core/IO/Path.pm
Expand Up @@ -76,10 +76,14 @@ my class IO::Path is Cool {
qq|"$.abspath".IO|;
}
multi method perl(IO::Path:D:) {
($.is-absolute
?? "q|$.abspath|.IO(:SPEC({$!SPEC.^name}))"
!! "q|$.path|.IO(:SPEC({$!SPEC.^name}),:CWD<$!CWD>)"
).subst(:global, '\\', '\\\\');
my $path = Rakudo::Internals.TRANSPOSE(
Rakudo::Internals.TRANSPOSE( ($.is-absolute ?? $.abspath !! $.path),
"\\", "\\\\"),
"|", "\\|");

$!is-absolute # attribute now set
?? "q|{$path}|.IO(:SPEC({$!SPEC.^name}))"
!! "q|{$path}|.IO(:SPEC({$!SPEC.^name}),:CWD<$!CWD>)"
}

method succ(IO::Path:D:) {
Expand Down

0 comments on commit 8d50dab

Please sign in to comment.