integrate cfgperl and vmsperl contents into mainline
[p5sagit/p5-mst-13.2.git] / lib / File / Spec / VMS.pm
index cf048c5..a2ac8ca 100644 (file)
@@ -142,16 +142,9 @@ sub canonpath {
       else          { return vmsify($path);  }
     }
     else {
->>>> 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{-\.-}{--};                     # -.-             ==> --
+      1 while $path =~ s{([\[<-])\.-}{$1-};             # [.-.-           ==> [--
       $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
@@ -191,7 +184,7 @@ sub catdir {
        elsif ($dir =~ /^\$\([^\)]+\)\z/s)          { $rslt = $dir; }
        else                                        { $rslt = vmspath($dir); }
     }
-    return $rslt;
+    return $self->canonpath($rslt);
 }
 
 =item catfile
@@ -219,7 +212,7 @@ sub catfile {
        }
     }
     else { $rslt = (defined($file) && length($file)) ? vmsify($file) : ''; }
-    return $rslt;
+    return $self->canonpath($rslt);
 }