Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Introduce $*SPEC.slash
because $*SPEC.rootdir may not cut it.  b2gills++ for spotting
  • Loading branch information
lizmat committed Oct 3, 2014
1 parent 854ba8d commit e0d5ddc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/core/CompUnitRepo/Local/File.pm
Expand Up @@ -28,7 +28,7 @@ class CompUnitRepo::Local::File does CompUnitRepo::Locally {
# sorry, cannot handle this one
return () unless %extensions{$from}:exists;

my $slash := $*SPEC.rootdir;
my $slash := $*SPEC.slash;
my $base := $!path ~ $slash ~ $name.subst(:g, "::", $slash) ~ '.';
if %seen{$base} -> $found {
return $found;
Expand Down
1 change: 1 addition & 0 deletions src/core/IO/Spec/Unix.pm
Expand Up @@ -17,6 +17,7 @@ my class IO::Spec::Unix is IO::Spec {
$path
}

method slash { '/' }
method curdir { '.' }
method updir { '..' }
method curupdir { none('.','..') }
Expand Down
9 changes: 5 additions & 4 deletions src/core/IO/Spec/Win32.pm
Expand Up @@ -17,10 +17,11 @@ my class IO::Spec::Win32 is IO::Spec::Unix {
self!canon-cat(|@dirs);
}

method splitdir($dir) { $dir.split($slash) }
method catfile(|c) { self.catdir(|c) }
method devnull { 'nul' }
method rootdir { '\\' }
method slash { '\\' }
method splitdir($dir) { $dir.split($slash) }
method catfile(|c) { self.catdir(|c) }
method devnull { 'nul' }
method rootdir { '\\' }

method tmpdir {
first( { .defined && .IO.d && .IO.w },
Expand Down

0 comments on commit e0d5ddc

Please sign in to comment.