From: Jarkko Hietaniemi Date: Wed, 12 Mar 2003 13:58:26 +0000 (+0000) Subject: File::Spec: Do not fall back to '', use curdir instead. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9ceb3593f68e23c6c86d61aa1d0832d35925849a;p=p5sagit%2Fp5-mst-13.2.git File::Spec: Do not fall back to '', use curdir instead. Note: Mac used to use cwd(), now curdir, slight change (relative vs. absolute). p4raw-id: //depot/perl@18956 --- diff --git a/lib/File/Spec/Cygwin.pm b/lib/File/Spec/Cygwin.pm index ac4e839..fcc8331 100644 --- a/lib/File/Spec/Cygwin.pm +++ b/lib/File/Spec/Cygwin.pm @@ -36,7 +36,7 @@ sub tmpdir { $tmpdir = $_; last; } - $tmpdir = '' unless defined $tmpdir; + $tmpdir = File::Spec->curdir unless defined $tmpdir; return $tmpdir; } diff --git a/lib/File/Spec/Mac.pm b/lib/File/Spec/Mac.pm index 6067b3c..2d71706 100644 --- a/lib/File/Spec/Mac.pm +++ b/lib/File/Spec/Mac.pm @@ -8,7 +8,6 @@ $VERSION = '1.3'; @ISA = qw(File::Spec::Unix); -use Cwd; my $macfiles; if ($^O eq 'MacOS') { $macfiles = eval { require Mac::Files }; @@ -371,9 +370,7 @@ my $tmpdir; sub tmpdir { return $tmpdir if defined $tmpdir; $tmpdir = $ENV{TMPDIR} if -d $ENV{TMPDIR}; - unless (defined($tmpdir)) { - $tmpdir = cwd(); - } + $tmpdir = File::Spec->curdir unless defined $tmpdir; return $tmpdir; } diff --git a/lib/File/Spec/OS2.pm b/lib/File/Spec/OS2.pm index e65186a..810ef8c 100644 --- a/lib/File/Spec/OS2.pm +++ b/lib/File/Spec/OS2.pm @@ -46,7 +46,7 @@ sub tmpdir { $tmpdir = $_; last; } - $tmpdir = '' unless defined $tmpdir; + $tmpdir = File::Spec->curdir unless defined $tmpdir; $tmpdir =~ s:\\:/:g; $tmpdir = $self->canonpath($tmpdir); return $tmpdir; diff --git a/lib/File/Spec/Unix.pm b/lib/File/Spec/Unix.pm index 4d917a0..705559f 100644 --- a/lib/File/Spec/Unix.pm +++ b/lib/File/Spec/Unix.pm @@ -154,7 +154,7 @@ sub tmpdir { $tmpdir = $_; last; } - $tmpdir = '' unless defined $tmpdir; + $tmpdir = File::Spec->curdir unless defined $tmpdir; return $tmpdir; } diff --git a/lib/File/Spec/VMS.pm b/lib/File/Spec/VMS.pm index 54fcee1..fab1953 100644 --- a/lib/File/Spec/VMS.pm +++ b/lib/File/Spec/VMS.pm @@ -291,7 +291,7 @@ sub tmpdir { $tmpdir = $_; last; } - $tmpdir = '' unless defined $tmpdir; + $tmpdir = File::Spec->curdir unless defined $tmpdir; return $tmpdir; } diff --git a/lib/File/Spec/Win32.pm b/lib/File/Spec/Win32.pm index 87a236b..1371edc 100644 --- a/lib/File/Spec/Win32.pm +++ b/lib/File/Spec/Win32.pm @@ -72,7 +72,7 @@ sub tmpdir { $tmpdir = $_; last; } - $tmpdir = '' unless defined $tmpdir; + $tmpdir = File::Spec->curdir unless defined $tmpdir; $tmpdir = $self->canonpath($tmpdir); return $tmpdir; }