From: Gurusamy Sarathy Date: Fri, 3 Mar 2000 02:58:49 +0000 (+0000) Subject: File::Spec bugs (spotted by Hack Kampbjorn ) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1d7cb664dc49858d069c4ad7e05c059b1003a3cd;p=p5sagit%2Fp5-mst-13.2.git File::Spec bugs (spotted by Hack Kampbjorn ) p4raw-id: //depot/perl@5472 --- diff --git a/lib/File/Spec/Mac.pm b/lib/File/Spec/Mac.pm index be9a43c..959e33d 100644 --- a/lib/File/Spec/Mac.pm +++ b/lib/File/Spec/Mac.pm @@ -343,8 +343,8 @@ sub abs2rel { Converts a relative path to an absolute path. - $abs_path = $File::Spec->rel2abs( $destination ) ; - $abs_path = $File::Spec->rel2abs( $destination, $base ) ; + $abs_path = File::Spec->rel2abs( $destination ) ; + $abs_path = File::Spec->rel2abs( $destination, $base ) ; If $base is not present or '', then L is used. If $base is relative, then it is converted to absolute form using L. This means that it diff --git a/lib/File/Spec/Unix.pm b/lib/File/Spec/Unix.pm index f4e9f27..0cbc8c7 100644 --- a/lib/File/Spec/Unix.pm +++ b/lib/File/Spec/Unix.pm @@ -383,8 +383,8 @@ sub abs2rel { Converts a relative path to an absolute path. - $abs_path = $File::Spec->rel2abs( $destination ) ; - $abs_path = $File::Spec->rel2abs( $destination, $base ) ; + $abs_path = File::Spec->rel2abs( $destination ) ; + $abs_path = File::Spec->rel2abs( $destination, $base ) ; If $base is not present or '', then L is used. If $base is relative, then it is converted to absolute form using L. This means that it diff --git a/lib/File/Spec/VMS.pm b/lib/File/Spec/VMS.pm index 52519b9..9514dd7 100644 --- a/lib/File/Spec/VMS.pm +++ b/lib/File/Spec/VMS.pm @@ -485,12 +485,12 @@ sub abs2rel { } # Figure out the effective $base and clean it up. - if ( ! $self->file_name_is_absolute( $base ) ) { - $base = $self->rel2abs( $base ) ; - } - elsif ( !defined( $base ) || $base eq '' ) { + if ( !defined( $base ) || $base eq '' ) { $base = cwd() ; } + elsif ( ! $self->file_name_is_absolute( $base ) ) { + $base = $self->rel2abs( $base ) ; + } else { $base = $self->canonpath( $base ) ; } diff --git a/lib/File/Spec/Win32.pm b/lib/File/Spec/Win32.pm index 85a71a2..aa95fbd 100644 --- a/lib/File/Spec/Win32.pm +++ b/lib/File/Spec/Win32.pm @@ -341,8 +341,8 @@ sub abs2rel { Converts a relative path to an absolute path. - $abs_path = $File::Spec->rel2abs( $destination ) ; - $abs_path = $File::Spec->rel2abs( $destination, $base ) ; + $abs_path = File::Spec->rel2abs( $destination ) ; + $abs_path = File::Spec->rel2abs( $destination, $base ) ; If $base is not present or '', then L is used. If $base is relative, then it is converted to absolute form using L. This means that it @@ -368,12 +368,12 @@ sub rel2abs($;$;) { if ( ! $self->file_name_is_absolute( $path ) ) { - if ( ! $self->file_name_is_absolute( $base ) ) { - $base = $self->rel2abs( $base ) ; - } - elsif ( !defined( $base ) || $base eq '' ) { + if ( !defined( $base ) || $base eq '' ) { $base = cwd() ; } + elsif ( ! $self->file_name_is_absolute( $base ) ) { + $base = $self->rel2abs( $base ) ; + } else { $base = $self->canonpath( $base ) ; }