[ "Win32->canonpath('//a/b/../../c')", '\\\\a\\b\\..\\..\\c' ],
[ "Win32->canonpath('//a/../../c')", '\\\\a\\..\\..\\c' ],
+## Hmmm, we should test missing and relative base paths some day...
+## would need to cd to a known place, get the cwd() and use it I
+## think.
[ "Win32->abs2rel('/t1/t2/t3','/t1/t2/t3')", '' ],
[ "Win32->abs2rel('/t1/t2/t4','/t1/t2/t3')", '..\\t4' ],
[ "Win32->abs2rel('/t1/t2','/t1/t2/t3')", '..' ],
[ "Win32->abs2rel('/./','/t1/t2/t3')", '..\\..\\..' ],
[ "Win32->abs2rel('\\\\a/t1/t2/t4','/t2/t3')", '..\\t4' ],
[ "Win32->abs2rel('//a/t1/t2/t4','/t2/t3')", '..\\t4' ],
+[ "Win32->abs2rel('A:/t1/t2/t3','B:/t1/t2/t3')",'' ],
+[ "Win32->abs2rel('A:/t1/t2/t3/t4','B:/t1/t2/t3')",'t4' ],
[ "Win32->rel2abs('temp','C:/')", 'C:\\temp' ],
[ "Win32->rel2abs('temp','C:/a')", 'C:\\a\\temp' ],
}
# Split up paths
- my ( $path_volume, $path_directories, $path_file ) =
+ my ( undef, $path_directories, $path_file ) =
$self->splitpath( $path, 1 ) ;
my $base_directories = ($self->splitpath( $base, 1 ))[1] ;
$path_directories = "$base_directories$path_directories" ;
}
- # It makes no sense to add a relative path to a UNC volume
- $path_volume = '' unless $path_volume =~ m{^[A-Z]:}is ;
-
return $self->canonpath(
- $self->catpath($path_volume, $path_directories, $path_file )
+ $self->catpath( "", $path_directories, $path_file )
) ;
}