Change 17913 by rgs@rgs-home on 2002/09/21 19:46:56

        Subject: [PATCH perl@17882] file spec tweaks for VMS
        From: "Craig A. Berry" <[EMAIL PROTECTED]>
        Date: Wed, 18 Sep 2002 16:57:02 -0500
        Message-ID: <[EMAIL PROTECTED]>

Affected files ...

.... //depot/perl/lib/File/Spec/VMS.pm#30 edit
.... //depot/perl/vms/ext/filespec.t#17 edit

Differences ...

==== //depot/perl/lib/File/Spec/VMS.pm#30 (text) ====
Index: perl/lib/File/Spec/VMS.pm
--- perl/lib/File/Spec/VMS.pm#29~13481~ Wed Dec  5 18:39:43 2001
+++ perl/lib/File/Spec/VMS.pm   Sat Sep 21 12:46:56 2002
@@ -164,6 +164,7 @@
       $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
+      $path =~ s/^[\[<\]>]{2}//;                        # []foo           ==> foo
       return $path;
     }
 }
@@ -211,7 +212,7 @@
 
 sub catfile {
     my ($self,@files) = @_;
-    my $file = pop @files;
+    my $file = $self->canonpath(pop @files);
     @files = grep($_,@files);
     my $rslt;
     if (@files) {

==== //depot/perl/vms/ext/filespec.t#17 (text) ====
Index: perl/vms/ext/filespec.t
--- perl/vms/ext/filespec.t#16~14902~   Wed Feb 27 13:17:38 2002
+++ perl/vms/ext/filespec.t     Sat Sep 21 12:46:56 2002
@@ -18,16 +18,17 @@
 foreach $test (@tests) {
   ($arg,$func,$expect) = split(/\s+/,$test);
 
+  $expect = undef if $expect eq 'undef';
   $rslt = eval "$func('$arg')";
-  is($@, '', "eval func('$arg')");
-  is($rslt, $expect, "  result");
+  is($@, '', "eval ${func}('$arg')");
+  is($rslt, $expect, "${func}('$arg'): '$rslt'");
 }
 
 $defwarn = <<'EOW';
 # Note: This failure may have occurred because your default device
 # was set using a non-concealed logical name.  If this is the case,
 # you will need to determine by inspection that the two resultant
-# file specifications shwn above are in fact equivalent.
+# file specifications shown above are in fact equivalent.
 EOW
 
 is(uc(rmsexpand('[]')),   "\U$ENV{DEFAULT}", 'rmsexpand()') || print $defwarn;
@@ -86,9 +87,9 @@
 __down_/__the_/__garden_/__path_       fileify __down_/__the_/__garden_/__path_.dir;1
 __down_:[__the_.__garden_]__path_      fileify __down_:[__the_.__garden_]__path_.dir;1
 __down_:[__the_.__garden_]__path_.     fileify # N.B. trailing . ==> null type
-__down_:[__the_]__garden_.__path_      fileify 
+__down_:[__the_]__garden_.__path_      fileify undef
 /__down_/__the_/__garden_/__path_.     fileify # N.B. trailing . ==> null type
-/__down_/__the_/__garden_.__path_      fileify 
+/__down_/__the_/__garden_.__path_      fileify undef
 
 # and pathifying them
 __down_:[__the_.__garden_]__path_.dir;1        pathify 
__down_:[__the_.__garden_.__path_]
@@ -97,15 +98,15 @@
 __down_/__the_/__garden_/__path_.dir   pathify __down_/__the_/__garden_/__path_/
 __down_:[__the_.__garden_]__path_      pathify __down_:[__the_.__garden_.__path_]
 __down_:[__the_.__garden_]__path_.     pathify # N.B. trailing . ==> null type
-__down_:[__the_]__garden_.__path_      pathify 
+__down_:[__the_]__garden_.__path_      pathify undef
 /__down_/__the_/__garden_/__path_.     pathify # N.B. trailing . ==> null type
-/__down_/__the_/__garden_.__path_      pathify 
+/__down_/__the_/__garden_.__path_      pathify undef
 __down_:[__the_.__garden_]__path_.dir;2        pathify #N.B. ;2
 __path_        pathify __path_/
 /__down_/__the_/__garden_/.    pathify /__down_/__the_/__garden_/./
 /__down_/__the_/__garden_/..   pathify /__down_/__the_/__garden_/../
 /__down_/__the_/__garden_/...  pathify /__down_/__the_/__garden_/.../
-__path_.notdir pathify 
+__path_.notdir pathify undef
 
 # Both VMS/Unix and file/path conversions
 __down_:[__the_.__garden_]__path_.dir;1        unixpath        
/__down_/__the_/__garden_/__path_/
End of Patch.

Reply via email to