From: Tim Jenness Date: Tue, 15 Aug 2000 15:51:59 +0000 (-1000) Subject: Cwd::_backtick_pwd does not check return value X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7e03f963b2d8f2b5ba6cfc37a31934125cf2d8bf;p=p5sagit%2Fp5-mst-13.2.git Cwd::_backtick_pwd does not check return value Message-ID: p4raw-id: //depot/perl@6651 --- diff --git a/lib/Cwd.pm b/lib/Cwd.pm index 9a92829..ecd0882 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; }