From: Gurusamy Sarathy Date: Mon, 28 Feb 2000 10:13:03 +0000 (+0000) Subject: avoid warnings in legacy code (from David Dyck) X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d5c3ff09f505a33428a0772c6e16c91e1df4ce85;p=p5sagit%2Fp5-mst-13.2.git avoid warnings in legacy code (from David Dyck) p4raw-id: //depot/perl@5321 --- diff --git a/lib/pwd.pl b/lib/pwd.pl index 47539aa..6b429eb 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"; } }