Missed from #20942.
authorJarkko Hietaniemi <jhi@iki.fi>
Sat, 30 Aug 2003 05:44:02 +0000 (05:44 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 30 Aug 2003 05:44:02 +0000 (05:44 +0000)
p4raw-id: //depot/perl@20943

lib/File/Spec/VMS.pm

index f259253..d77601e 100644 (file)
@@ -412,6 +412,21 @@ sub abs2rel {
         $base = $self->canonpath( $base ) ;
     }
 
+    # Are we even starting $path on the same (node::)device as $base?  Note that
+    # logical paths or nodename differences may be on the "same device" 
+    # but the comparison that ignores device differences so as to concatenate 
+    # [---] up directory specs is not even a good idea in cases where there is 
+    # a logical path difference between $path and $base nodename and/or device.
+    # Hence we fall back to returning the absolute $path spec
+    # if there is a case blind device (or node) difference of any sort
+    # and we do not even try to call $parse() or consult %ENV for $trnlnm()
+    # (this module needs to run on non VMS platforms after all).
+    my $path_device = ($self->splitpath( $path, 1 ))[0];
+    my $base_device = ($self->splitpath( $base, 1 ))[0];
+    if ( lc( $path_device ) ne lc( $base_device ) ) {
+        return ( $path ) ;
+    }
+
     # Split up paths
     my ( $path_directories, $path_file ) =
         ($self->splitpath( $path, 1 ))[1,2] ;