summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-02-28 10:13:03 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-02-28 10:13:03 +0000
commitd5c3ff09f505a33428a0772c6e16c91e1df4ce85 (patch)
treef2324846f47b73dba7790f634b46b2e0d3f835d5
parent928e06a670886d261ece304e1023e27673463938 (diff)
downloadperl-d5c3ff09f505a33428a0772c6e16c91e1df4ce85.tar.gz
avoid warnings in legacy code (from David Dyck)
p4raw-id: //depot/perl@5321
-rw-r--r--lib/pwd.pl4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pwd.pl b/lib/pwd.pl
index 47539aa4c6..6b429eb5a6 100644
--- a/lib/pwd.pl
+++ b/lib/pwd.pl
@@ -25,7 +25,7 @@ sub main'initpwd {
if ($ENV{'PWD'}) {
local($dd,$di) = stat('.');
local($pd,$pi) = stat($ENV{'PWD'});
- if ($di != $pi || $dd != $pd) {
+ if (!defined $dd or !defined $pd or $di != $pi or $dd != $pd) {
chop($ENV{'PWD'} = `pwd`);
}
}
@@ -35,7 +35,7 @@ sub main'initpwd {
if ($ENV{'PWD'} =~ m|(/[^/]+(/[^/]+/[^/]+))(.*)|) {
local($pd,$pi) = stat($2);
local($dd,$di) = stat($1);
- if ($di == $pi && $dd == $pd) {
+ if (defined $pd and defined $dd and $di == $pi and $dd == $pd) {
$ENV{'PWD'}="$2$3";
}
}