diff options
author | Michael G. Schwern <schwern@pobox.com> | 2002-01-13 16:00:07 -0500 |
---|---|---|
committer | Abhijit Menon-Sen <ams@wiw.org> | 2002-01-14 03:15:05 +0000 |
commit | 73b801a60cb6aa35dadd081292289a75e703112e (patch) | |
tree | 5e62fc363d2f674d13b66bb0fc9deddad3d228dd /lib/Cwd.pm | |
parent | a37c3bb4b6c8295b3c26774dc457317671302dc9 (diff) | |
download | perl-73b801a60cb6aa35dadd081292289a75e703112e.tar.gz |
Re: [ID 20020113.006] Cwd.pm uses uninitialized $ENV{PATH}
Message-Id: <20020114020007.GB2877@blackrider>
p4raw-id: //depot/perl@14253
Diffstat (limited to 'lib/Cwd.pm')
-rw-r--r-- | lib/Cwd.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Cwd.pm b/lib/Cwd.pm index 63a14fdcbc..0db9410cc6 100644 --- a/lib/Cwd.pm +++ b/lib/Cwd.pm @@ -200,7 +200,9 @@ sub _backtick_pwd { unless(defined &cwd) { # The pwd command is not available in some chroot(2)'ed environments - if($^O eq 'MacOS' || grep { -x "$_/pwd" } split(':', $ENV{PATH})) { + if( $^O eq 'MacOS' || (defined $ENV{PATH} && + grep { -x "$_/pwd" } split(':', $ENV{PATH})) ) + { *cwd = \&_backtick_pwd; } else { |