From: Jarkko Hietaniemi Date: Mon, 18 Aug 2003 07:01:16 +0000 (+0000) Subject: I could have sworn the base class method was there. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c063e98f8c69b3768b03c1dc05dae8a9c315cd4b;p=p5sagit%2Fp5-mst-13.2.git I could have sworn the base class method was there. p4raw-id: //depot/perl@20752 --- diff --git a/lib/File/Spec/Unix.pm b/lib/File/Spec/Unix.pm index e276729..c76152b 100644 --- a/lib/File/Spec/Unix.pm +++ b/lib/File/Spec/Unix.pm @@ -338,9 +338,10 @@ from the base path to the destination path: $rel_path = File::Spec->abs2rel( $path ) ; $rel_path = File::Spec->abs2rel( $path, $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 -is taken to be relative to L. +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 is taken to be relative to +L. On systems with the concept of a volume, this assumes that both paths are on the $destination volume, and ignores the $base volume. @@ -373,8 +374,7 @@ sub abs2rel { # Figure out the effective $base and clean it up. if ( !defined( $base ) || $base eq '' ) { - require Cwd; - $base = Cwd::cwd() ; + $base = $self->cwd(); } elsif ( ! $self->file_name_is_absolute( $base ) ) { $base = $self->rel2abs( $base ) ; @@ -463,7 +463,6 @@ sub rel2abs { return $self->canonpath( $path ) ; } - =back =head1 SEE ALSO @@ -472,4 +471,12 @@ L =cut +# Internal routine to File::Spec, no point in publicly documenting +# this interface since it's the standard Cwd interface. Some of the +# platform-specific File::Spec subclasses use this. +sub cwd { + require Cwd; + Cwd::cwd(); +} + 1;