Skip to content

Commit

Permalink
Undo IO::Path.resolve fix on JVM
Browse files Browse the repository at this point in the history
Seems it doesn't know about ut8-c8 yet, so swap JVM to use
the pre-fix code.
  • Loading branch information
zoffixznet committed Apr 18, 2017
1 parent c9ebfc2 commit 88a6fac
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/core/IO/Path.pm
Expand Up @@ -239,7 +239,13 @@ my class IO::Path is Cool does IO {
my str $empty = '';
my str $resolved = $empty;
my Mu $res-list := nqp::list_s();

#?if jvm
# Apparently JVM doesn't know how to decode to utf8-c8 yet
# so it's still afflicted by the bug that, say, "/\[x308]" in the path
# doesn't get recognized as a path separator
my $parts := nqp::split($sep, nqp::unbox_s(self.absolute));
#?endif
#?if !jvm
# In this bit, we work with bytes, converting $sep (and assuming it's
# 1-char long) in the path to nul bytes and then splitting the path
# on nul bytes. This way, even if we get some weird paths like
Expand All @@ -257,6 +263,7 @@ my class IO::Path is Cool does IO {
nqp::iseq_i(nqp::atpos_i($p, $i), $ord-sep),
nqp::atposref_i($p, $i) = 0)),
my $parts := nqp::split("\0", nqp::decode($p, 'utf8-c8')));
#?endif

while $parts {
fail "Resolved path too deep!"
Expand Down

0 comments on commit 88a6fac

Please sign in to comment.