Re: [blead 2009-05-29.22:08:17] vms.c EFS logical name fix.
"John E. Malmberg" <[email protected]>
| Newsgroups | gmane.comp.lang.perl.ports.vms |
|---|---|
| Message-ID | <[email protected]> |
Craig A. Berry wrote: > > > I went back to my original test case (not the narrower one you ended up > fixing) and it looks like we are half-way there. If both > DECC$EFS_CHARSET and DECC$FILENAME_UNIX_REPORT are defined, this works: > > $ perl -"MFile::Spec::Functions" -e "print catfile(File::Spec->tmpdir(), > 'bar');" > /sys$scratch/bar > > but if only DECC$EFS_CHARSET is defined, it doesn't: > > $ perl -"MFile::Spec::Functions" -e "print catfile(File::Spec->tmpdir(), > 'bar');" > [.sys$scratch:]bar The attached patch has not been run through a full test run yet. The problem was that catfile was expecting that the path components were either contained VMS directory delimiters or were bare words. The earlier part of the code detected the trailing ":" so knew to treat the path a VMS. This patch allows a path ending with a ":" to be treated as a VMS directory path. -John [email protected] Personal Opinion Only
file_spec_vms_pm.gdiff
(text/plain, 743 B)
--- /rsync_root/perl/lib/File/Spec/VMS.pm Sun May 10 04:02:09 2009
+++ lib/File/Spec/VMS.pm Sun Jun 7 13:01:54 2009
@@ -445,7 +445,12 @@
$spath = '[' . $spath . ']' if $spath =~ /^-/;
$rslt = vmspath($spath);
} else {
- $rslt = '[.' . $spath . ']';
+ if ($spath =~ /:$/) {
+ # Handle device name with out directory for path.
+ $rslt = $spath;
+ } else {
+ $rslt = '[.' . $spath . ']';
+ }
}
$file = vmsify($file) if ($file_unix);
} else {