summaryrefslogtreecommitdiff
path: root/lib/File/Spec/Win32.pm
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-03-14 13:42:32 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-03-14 13:42:32 +0000
commit07824bd1cfb16e641e5040a9a4e23799f5535a53 (patch)
tree94d58132d4adec2beef7fb3afdd83a4defd65e7d /lib/File/Spec/Win32.pm
parent7f1236c00d2708a214ae3f72897a3a14ec6d9792 (diff)
downloadperl-07824bd1cfb16e641e5040a9a4e23799f5535a53.tar.gz
Cleanup the File::Spec tmpdir() implementations:
now all the platforms specific modules call _tmpdir() (inherited from Unix.pm) with the list of platform specific list of temporary directories, and _tmpdir() then does the appropriate suitability checking. p4raw-id: //depot/perl@18980
Diffstat (limited to 'lib/File/Spec/Win32.pm')
-rw-r--r--lib/File/Spec/Win32.pm27
1 files changed, 9 insertions, 18 deletions
diff --git a/lib/File/Spec/Win32.pm b/lib/File/Spec/Win32.pm
index 1371edc9bb..9e7bb39892 100644
--- a/lib/File/Spec/Win32.pm
+++ b/lib/File/Spec/Win32.pm
@@ -2,10 +2,11 @@ package File::Spec::Win32;
use strict;
use Cwd;
+
use vars qw(@ISA $VERSION);
require File::Spec::Unix;
-$VERSION = '1.3';
+$VERSION = '1.4';
@ISA = qw(File::Spec::Unix);
@@ -48,7 +49,8 @@ from the following list:
/tmp
/
-The SYS:/temp is preferred in Novell NetWare.
+The SYS:/temp is preferred in Novell NetWare (the File::Spec::Win32
+is used also for NetWare).
Since Perl 5.8.0, if running under taint mode, and if the environment
variables are tainted, they are not used.
@@ -59,22 +61,11 @@ my $tmpdir;
sub tmpdir {
return $tmpdir if defined $tmpdir;
my $self = shift;
- my @dirlist = (@ENV{qw(TMPDIR TEMP TMP)}, qw(C:/temp /tmp /));
- {
- no strict 'refs';
- if (${"\cTAINT"}) { # Check for taint mode on perl >= 5.8.0
- require Scalar::Util;
- @dirlist = grep { ! Scalar::Util::tainted $_ } @dirlist;
- }
- }
- foreach (@dirlist) {
- next unless defined && -d;
- $tmpdir = $_;
- last;
- }
- $tmpdir = File::Spec->curdir unless defined $tmpdir;
- $tmpdir = $self->canonpath($tmpdir);
- return $tmpdir;
+ $tmpdir = $self->_tmpdir( @ENV{qw(TMPDIR TEMP TMP)},
+ 'SYS:/temp',
+ 'C:/temp',
+ '/tmp',
+ '/' );
}
sub case_tolerant {