Skip to content

Commit

Permalink
Fix &chdir failing to respect :CWD attribute
Browse files Browse the repository at this point in the history
The method simply uses Str() coercion, but .Str on IO::Paths
ignores their :CWD attribute, which causes &chdir into such
IO::Paths to chdir into the wrong dir.
  • Loading branch information
zoffixznet committed Oct 2, 2017
1 parent e513b85 commit 4906a1d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/core/IO/Path.pm
Expand Up @@ -408,6 +408,9 @@ my class IO::Path is Cool does IO {
);
self.chdir: $path, |$test.words.map(* => True).Hash;
}
multi method chdir(IO::Path:D: IO $path, |c) {
self.chdir: $path.absolute, |c
}
multi method chdir(
IO::Path:D: Str() $path is copy, :$d = True, :$r, :$w, :$x,
) {
Expand Down

0 comments on commit 4906a1d

Please sign in to comment.