summaryrefslogtreecommitdiff
path: root/lib/File
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-08-21 14:12:29 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-08-21 14:12:29 +0000
commit0fab864c5c385dce2d3f87afc92636d35d7ccd9e (patch)
treeb1a87eafb355d5dee24f1949f2d46eecc48d1e09 /lib/File
parentdccec5e607e831ba5c38d0901281ab237afd81eb (diff)
downloadperl-0fab864c5c385dce2d3f87afc92636d35d7ccd9e.tar.gz
Rename the internal cwd() to _cwd() (it's not curdir).
p4raw-id: //depot/perl@20798
Diffstat (limited to 'lib/File')
-rw-r--r--lib/File/Spec/Mac.pm4
-rw-r--r--lib/File/Spec/OS2.pm6
-rw-r--r--lib/File/Spec/Unix.pm19
-rw-r--r--lib/File/Spec/VMS.pm4
-rw-r--r--lib/File/Spec/Win32.pm6
5 files changed, 20 insertions, 19 deletions
diff --git a/lib/File/Spec/Mac.pm b/lib/File/Spec/Mac.pm
index 83bd7094b5..1de06b83f1 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 e689c78928..1ff32783bd 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 703d23a7ee..9fc556f0c4 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<cwd()|Cwd> is used. If $base is relative,
-then it is converted to absolute form using L</rel2abs()>. This means that it
-is taken to be relative to L<cwd()|Cwd>.
+If $base is not present or '', then L<cwd()|Cwd> is used. If $base is
+relative, then it is converted to absolute form using
+L</rel2abs()>. This means that it is taken to be relative to
+L<cwd()|Cwd>.
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<File::Spec>
=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 400057198f..f259253fd6 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 d97708ad22..a5db2cce0f 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 ) ;