Thanks. I've applied the patch.
-Ken
On Nov 18, 2004, at 7:05 PM, Craig A. Berry wrote:
There is a canonpath case where we reduce redundant directories down to
nothing but should instead reduce them to the magical six zeros root
directory. There have been two different definitions of "nothing" in
recent history.
Before File::Spec 0.89:
$ perl -"MFile::Spec" -e "print
File::Spec->canonpath('d0:[d1.-]foo.dat');"
d0:[]foo.dat
Starting with 0.89:
$ perl -"MFile::Spec" -e "print
File::Spec->canonpath('d0:[d1.-]foo.dat');"
d0:foo.dat
These are both wrong, though the MakeMaker test infrastructure
preferred
the old wrong way to the new wrong way. What we should see (and do
after
the attached patch) is:
$ perl -"MFile::Spec" -e "print
File::Spec->canonpath('d0:[d1.-]foo.dat');"
d0:[000000]foo.dat
which compares favorably to what the native filename syntax parser
does:
$ write sys$output f$parse("d0:[d1.-]foo.dat")
D0:[000000]FOO.DAT;
--- lib/File/Spec/VMS.pm;-0 Mon Nov 1 10:03:24 2004
+++ lib/File/Spec/VMS.pm Thu Nov 11 09:15:52 2004
@@ -182,7 +182,7 @@ sub canonpath {
$path =~ s/\.[^\]\.]+\.-\./\./g; # .foo.-. ==> .
$path =~ s/\[[^\]\.]+\.-\./\[/g; # [foo.-. ==> [
$path =~ s/\.[^\]\.]+\.-\]/\]/g; # .foo.-] ==> ]
- $path =~ s/\[[^\]\.]+\.-\]/\[\]/g; # [foo.-] ==> []
+ $path =~ s/\[[^\]\.]+\.-\]/\[000000\]/g;# [foo.-] ==> [000000]
$path =~ s/\[\]//; # [] ==>
return $path;
}
--- lib/File/Spec/t/Spec.t;-0 Sun Sep 5 17:29:24 2004
+++ lib/File/Spec/t/Spec.t Thu Nov 11 08:52:52 2004
@@ -322,6 +322,7 @@
[ "VMS->canonpath('[d1.000000.][000000.][d3.--.000000]file.txt')",
'[d1.000000]file.txt' ],
[
"VMS->canonpath('volume:[d1.000000.][000000.][-.-.000000]file.txt')",
'volume:[000000]file.txt' ],
[ "VMS->canonpath('[d1.000000.][000000.][--.-.000000]file.txt')",
'[-.000000]file.txt' ],
+[ "VMS->canonpath('[d1.d2.--]file')",
'[000000]file' ],
[ "VMS->splitdir('')", '' ],
[ "VMS->splitdir('[]')", '' ],