Skip to content

Commit

Permalink
Merge branch 'nom' of https://github.com/labster/rakudo into nom
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed May 6, 2013
2 parents c2736b2 + 6e9f456 commit 540c014
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/core/IO/Spec/Win32.pm
Expand Up @@ -75,9 +75,12 @@ my class IO::Spec::Win32 is IO::Spec::Unix {
return (:$volume, :$directory, :$basename);
}

method join ($volume, $directory is copy, $file) {
$directory = '' if all($directory, $file) eq any('/','\\')
or $directory eq '.' && $file.chars;
method join ($volume, $directory is copy, $file is copy) {
$directory = '' if $directory eq '.' && $file.chars;
if $directory.match( /^<$slash>$/ ) && $file.match( /^<$slash>$/ ) {
$file = '';
$directory = '' if $volume.chars > 2; #i.e. UNC path
}
self.catpath($volume, $directory, $file);
}

Expand Down Expand Up @@ -108,12 +111,12 @@ my class IO::Spec::Win32 is IO::Spec::Unix {

# Make sure the glue separator is present
# unless it's a relative path like A:foo.txt
if $volume ne ''
if $volume.chars and $directory.chars
and $volume !~~ /^<$driveletter>/
and $volume !~~ /<$slash> $/
and $directory !~~ /^ <$slash>/
{ $volume ~= '\\' }
if $file ne '' and $directory ne ''
if $file.chars and $directory.chars
and $directory !~~ /<$slash> $/
{ $volume ~ $directory ~ '\\' ~ $file; }
else { $volume ~ $directory ~ $file; }
Expand Down
6 changes: 6 additions & 0 deletions t/spectest.data
Expand Up @@ -606,6 +606,12 @@ S32-io/chdir.t
S32-io/copy.t
S32-io/dir.t
S32-io/file-tests.t
S32-io/io-spec-unix.t
S32-io/io-spec-win.t
S32-io/io-spec-cygwin.t
S32-io/io-path-unix.t
S32-io/io-path-win.t
S32-io/io-path-cygwin.t
S32-io/io-path.t
S32-io/IO-Socket-INET.t
S32-io/note.t
Expand Down

0 comments on commit 540c014

Please sign in to comment.