Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix dirname/succ/pred
  • Loading branch information
lizmat committed Nov 1, 2014
1 parent c7e4401 commit 685ee66
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/IO/Dir.pm
Expand Up @@ -66,7 +66,7 @@ my class IO::Dir does IO {
}

method volume(IO::Dir:D:) { self!parts; @!parts[0] }
method dirname(IO::Dir:D:) { $!abspath.chop }
method dirname(IO::Dir:D:) { self!parts; @!parts[1 .. *-2].join('/') }
method basename(IO::Dir:D:) { MAKE-BASENAME($!abspath.chop) }

method Numeric(IO::Dir:D:) { self.basename.Numeric }
Expand All @@ -77,8 +77,8 @@ my class IO::Dir does IO {
method gist(IO::Dir:D:) { "q|$!abspath|.IO" }
method perl(IO::Dir:D:) { "q|$!abspath|.IO" }

# method succ(IO::Dir:D:) { MAKE-SUCC($!abspath.chop) ~ '/' }
# method pred(IO::Dir:D:) { MAKE-PRED($!abspath.chop) ~ '/' }
method succ(IO::Dir:D:) { my $p = $!abspath.chop; ++$p ~ '/' }
method pred(IO::Dir:D:) { my $p = $!abspath.chop; --$p ~ '/' }

method e(IO::Dir:D:) { True }
method d(IO::Dir:D:) { True }
Expand Down

0 comments on commit 685ee66

Please sign in to comment.