From: Jarkko Hietaniemi Date: Thu, 21 Aug 2003 14:12:29 +0000 (+0000) Subject: Rename the internal cwd() to _cwd() (it's not curdir). X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0fab864c5c385dce2d3f87afc92636d35d7ccd9e;p=p5sagit%2Fp5-mst-13.2.git Rename the internal cwd() to _cwd() (it's not curdir). p4raw-id: //depot/perl@20798 --- diff --git a/lib/File/Spec/Mac.pm b/lib/File/Spec/Mac.pm index 83bd709..1de06b8 100644 --- a/lib/File/Spec/Mac.pm +++ b/lib/File/Spec/Mac.pm @@ -656,7 +656,7 @@ sub abs2rel { # Figure out the effective $base and clean it up. if ( !defined( $base ) || $base eq '' ) { - $base = $self->cwd(); + $base = $self->_cwd(); } elsif ( ! $self->file_name_is_absolute( $base ) ) { $base = $self->rel2abs( $base ) ; @@ -724,7 +724,7 @@ sub rel2abs { if ( ! $self->file_name_is_absolute($path) ) { # Figure out the effective $base and clean it up. if ( !defined( $base ) || $base eq '' ) { - $base = $self->cwd(); + $base = $self->_cwd(); } elsif ( ! $self->file_name_is_absolute($base) ) { $base = $self->rel2abs($base) ; diff --git a/lib/File/Spec/OS2.pm b/lib/File/Spec/OS2.pm index e689c78..1ff3278 100644 --- a/lib/File/Spec/OS2.pm +++ b/lib/File/Spec/OS2.pm @@ -29,7 +29,7 @@ sub path { return @path; } -sub cwd { +sub _cwd { # In OS/2 the "require Cwd" is unnecessary bloat. return Cwd::sys_cwd(); } @@ -205,7 +205,7 @@ sub abs2rel { # Figure out the effective $base and clean it up. if ( !defined( $base ) || $base eq '' ) { - $base = $self->cwd(); + $base = $self->_cwd(); } elsif ( ! $self->file_name_is_absolute( $base ) ) { $base = $self->rel2abs( $base ) ; } else { @@ -263,7 +263,7 @@ sub rel2abs { if ( ! $self->file_name_is_absolute( $path ) ) { if ( !defined( $base ) || $base eq '' ) { - $base = $self->cwd(); + $base = $self->_cwd(); } elsif ( ! $self->file_name_is_absolute( $base ) ) { $base = $self->rel2abs( $base ) ; diff --git a/lib/File/Spec/Unix.pm b/lib/File/Spec/Unix.pm index 703d23a..9fc556f 100644 --- a/lib/File/Spec/Unix.pm +++ b/lib/File/Spec/Unix.pm @@ -374,7 +374,7 @@ sub abs2rel { # Figure out the effective $base and clean it up. if ( !defined( $base ) || $base eq '' ) { - $base = $self->cwd(); + $base = $self->_cwd(); } elsif ( ! $self->file_name_is_absolute( $base ) ) { $base = $self->rel2abs( $base ) ; @@ -418,9 +418,10 @@ Converts a relative path to an absolute path. $abs_path = File::Spec->rel2abs( $path ) ; $abs_path = File::Spec->rel2abs( $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 $base volume, and ignores the $path volume. @@ -446,7 +447,7 @@ sub rel2abs { if ( ! $self->file_name_is_absolute( $path ) ) { # Figure out the effective $base and clean it up. if ( !defined( $base ) || $base eq '' ) { - $base = $self->cwd(); + $base = $self->_cwd(); } elsif ( ! $self->file_name_is_absolute( $base ) ) { $base = $self->rel2abs( $base ) ; @@ -470,10 +471,10 @@ 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 { +# Internal routine to File::Spec, no point in making this public since +# it is the standard Cwd interface. Most of the platform-specific +# File::Spec subclasses use this. +sub _cwd { require Cwd; Cwd::cwd(); } diff --git a/lib/File/Spec/VMS.pm b/lib/File/Spec/VMS.pm index 4000571..f259253 100644 --- a/lib/File/Spec/VMS.pm +++ b/lib/File/Spec/VMS.pm @@ -403,7 +403,7 @@ sub abs2rel { # Figure out the effective $base and clean it up. if ( !defined( $base ) || $base eq '' ) { - $base = $self->canonpath( $self->cwd ) ; + $base = $self->canonpath( $self->_cwd ) ; } elsif ( ! $self->file_name_is_absolute( $base ) ) { $base = $self->rel2abs( $base ) ; @@ -462,7 +462,7 @@ sub rel2abs { if ( ! $self->file_name_is_absolute( $path ) ) { # Figure out the effective $base and clean it up. if ( !defined( $base ) || $base eq '' ) { - $base = $self->cwd; + $base = $self->_cwd; } elsif ( ! $self->file_name_is_absolute( $base ) ) { $base = $self->rel2abs( $base ) ; diff --git a/lib/File/Spec/Win32.pm b/lib/File/Spec/Win32.pm index d97708a..a5db2cc 100644 --- a/lib/File/Spec/Win32.pm +++ b/lib/File/Spec/Win32.pm @@ -287,7 +287,7 @@ sub catpath { sub abs2rel { my($self,$path,$base) = @_; - $base = $self->cwd() unless defined $base and length $base; + $base = $self->_cwd() unless defined $base and length $base; for ($path, $base) { $_ = $self->canonpath($self->rel2abs($_)); @@ -296,7 +296,7 @@ sub abs2rel { my ($base_volume, $base_directories) = $self->splitpath($base, 1); if ($path_volume and not $base_volume) { - ($base_volume) = $self->splitpath($self->cwd); + ($base_volume) = $self->splitpath($self->_cwd); } # Can't relativize across volumes @@ -326,7 +326,7 @@ sub rel2abs { if ( ! $self->file_name_is_absolute( $path ) ) { if ( !defined( $base ) || $base eq '' ) { - $base = $self->cwd() ; + $base = $self->_cwd() ; } elsif ( ! $self->file_name_is_absolute( $base ) ) { $base = $self->rel2abs( $base ) ;