summaryrefslogtreecommitdiff
path: root/lib/Cwd.pm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-06-17 09:26:25 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2005-06-17 09:26:25 +0000
commitf6342b4b53f678226f6ef9a63cf476fbf96744f4 (patch)
treefc1b82b6e72e42e8f056eafc3242a72a6ce134fa /lib/Cwd.pm
parent437a6bf1fc3f48814cc26e6154b748c3f2617816 (diff)
downloadperl-f6342b4b53f678226f6ef9a63cf476fbf96744f4.tar.gz
Upgrade to PathTools 3.09
p4raw-id: //depot/perl@24882
Diffstat (limited to 'lib/Cwd.pm')
-rw-r--r--lib/Cwd.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Cwd.pm b/lib/Cwd.pm
index d00c8fe0a0..18f4b652f4 100644
--- a/lib/Cwd.pm
+++ b/lib/Cwd.pm
@@ -170,7 +170,7 @@ use strict;
use Exporter;
use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION);
-$VERSION = '3.08';
+$VERSION = '3.09';
@ISA = qw/ Exporter /;
@EXPORT = qw(cwd getcwd fastcwd fastgetcwd);
@@ -315,7 +315,10 @@ sub _croak { require Carp; Carp::croak(@_) }
# The 'natural and safe form' for UNIX (pwd may be setuid root)
sub _backtick_pwd {
- local @ENV{qw(PATH IFS CDPATH ENV BASH_ENV)};
+ # Localize %ENV entries in a way that won't create new hash keys
+ my @localize = grep exists $ENV{$_}, qw(PATH IFS CDPATH ENV BASH_ENV);
+ local @ENV{@localize};
+
my $cwd = `$pwd_cmd`;
# Belt-and-suspenders in case someone said "undef $/".
local $/ = "\n";
@@ -642,10 +645,7 @@ sub _win32_cwd {
return $ENV{'PWD'};
}
-*_NT_cwd = \&_win32_cwd if (!defined &_NT_cwd &&
- defined &Win32::GetCwd);
-
-*_NT_cwd = \&_os2_cwd unless defined &_NT_cwd;
+*_NT_cwd = defined &Win32::GetCwd ? \&_win32_cwd : \&_os2_cwd;
sub _dos_cwd {
if (!defined &Dos::GetCwd) {