Changeset 17606 for ext

Show
Ignore:
Timestamp:
09/02/07 15:06:11 (16 months ago)
Author:
masak
Message:

[File::Spec::Win32]
* worked around the strange array init bug
* module tests now pass

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • ext/File-Spec/lib/File/Spec/Win32.pm

    r12776 r17606  
    4848    my @path = @_path; 
    4949    my @new_path; 
    50     my $i = 0; 
    51     loop ($i = 0; $i < @path; $i++) { 
    52         @path[$i] ~~ s:P5:g"/"\\"; 
    53         if (@path[$i] ~~ m:P5"\\$") { 
    54             push(@new_path, @path[$i]); 
     50    @new_path = gather { 
     51      for @path -> $part { 
     52 
     53        if $part !~~ m:P5"\\$" { 
     54          take $part ~ "\\"; 
    5555        } 
    5656        else { 
    57             push(@new_path, @path[$i] ~ "\\"); 
    58         } 
    59     } 
     57          take $part; 
     58        } 
     59      } 
     60    }; 
     61 
    6062    return canonpath(join('', @new_path)); 
    6163}