summaryrefslogtreecommitdiff
path: root/lib/File/Spec/OS2.pm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2001-11-06 22:45:01 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2001-11-07 01:22:40 +0000
commita384e9e1be3de1dac7ce4a6952ba555727054ca7 (patch)
tree410c07192354d653062e716e6118cde5a8c90d70 /lib/File/Spec/OS2.pm
parent3e90d5a3156f71fc1a63780fe898a92da05fc766 (diff)
downloadperl-a384e9e1be3de1dac7ce4a6952ba555727054ca7.tar.gz
a bunch of untested patches
Message-ID: <20011106214501.A704@rafael> p4raw-id: //depot/perl@12879
Diffstat (limited to 'lib/File/Spec/OS2.pm')
-rw-r--r--lib/File/Spec/OS2.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/File/Spec/OS2.pm b/lib/File/Spec/OS2.pm
index 20bf8c9dce..6392ba4acb 100644
--- a/lib/File/Spec/OS2.pm
+++ b/lib/File/Spec/OS2.pm
@@ -33,7 +33,15 @@ my $tmpdir;
sub tmpdir {
return $tmpdir if defined $tmpdir;
my $self = shift;
- foreach (@ENV{qw(TMPDIR TEMP TMP)}, qw(/tmp /)) {
+ my @dirlist = ( @ENV{qw(TMPDIR TEMP TMP)}, qw(/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;