else { return vmsify($path); }
}
else {
- $path =~ s-\]\[--g; $path =~ s/><//g; # foo.][bar ==> foo.bar
- $path =~ s/([\[<])000000\./$1/; # [000000.foo ==> foo
++>>>> ORIGINAL VMS.pm#13
++ $path =~ s-\]\[--g; $path =~ s/><//g; # foo.][bar ==> foo.bar
++ $path =~ s/([\[<])000000\./$1/; # [000000.foo ==> foo
++ if ($reduce_ricochet) {
++ $path =~ s/\.[^\[<\.]+\.-([\]\>])/$1/g;
++ $path =~ s/([\[<\.])([^\[<\.]+)\.-\.?/$1/g;
++ }
+ $path =~ s-\]\[--g; $path =~ s/><//g; # foo.][bar ==> foo.bar
+ $path =~ s/([\[<])000000\./$1/; # [000000.foo ==> foo
+ 1 while $path =~ s{-\.-}{--}; # -.- ==> --
+ $path =~ s/\.[^\[<\.]+\.-([\]\>])/$1/; # bar.foo.-] ==> bar]
+ $path =~ s/([\[<])(-+)/$1 . "\cx" x length($2)/e; # encode leading '-'s
+ $path =~ s/([\[<\.])([^\[<\.\cx]+)\.-\.?/$1/g; # bar.-.foo ==> foo
+ $path =~ s/([\[<])(\cx+)/$1 . '-' x length($2)/e; # then decode
return $path;
}
}
[ "VMS->canonpath('')", '' ],
[ "VMS->canonpath('volume:[d1]file')", 'volume:[d1]file' ],
-[ "VMS->canonpath('volume:[d1.-.d2.][d3.d4.-]')", 'volume:[d1.-.d2.d3.d4.-]' ],
+[ "VMS->canonpath('volume:[d1.-.d2.][d3.d4.-]')", 'volume:[d2.d3]' ],
[ "VMS->canonpath('volume:[000000.d1]d2.dir;1')", 'volume:[d1]d2.dir;1' ],
- [ "VMS->canonpath('///../../..//./././a//b/.././c/././')", '/a/b/../c' ],
[ "VMS->splitdir('')", '' ],
[ "VMS->splitdir('[]')", '' ],