summaryrefslogtreecommitdiff
path: root/lib/Cwd.pm
diff options
context:
space:
mode:
authorTim Jenness <tjenness@cpan.org>2000-08-15 05:51:59 -1000
committerJarkko Hietaniemi <jhi@iki.fi>2000-08-16 13:22:35 +0000
commit7e03f963b2d8f2b5ba6cfc37a31934125cf2d8bf (patch)
treeecdedf3dd5c00b6740a7a7b82a022238580eb433 /lib/Cwd.pm
parent05d2a450021acf4e4872f27fe51044b573e5d96c (diff)
downloadperl-7e03f963b2d8f2b5ba6cfc37a31934125cf2d8bf.tar.gz
Cwd::_backtick_pwd does not check return value
Message-ID: <Pine.LNX.4.21.0008151547560.1223-100000@lapaki.jach.hawaii.edu> p4raw-id: //depot/perl@6651
Diffstat (limited to 'lib/Cwd.pm')
-rw-r--r--lib/Cwd.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Cwd.pm b/lib/Cwd.pm
index 9a92829da5..ecd088298b 100644
--- a/lib/Cwd.pm
+++ b/lib/Cwd.pm
@@ -81,8 +81,9 @@ require Exporter;
# The 'natural and safe form' for UNIX (pwd may be setuid root)
sub _backtick_pwd {
- my $cwd;
- chop($cwd = `pwd`);
+ my $cwd = `pwd`;
+ # `pwd` may fail e.g. if the disk is full
+ chomp($cwd) if defined $cwd;
$cwd;
}