diff options
author | Larry Wall <lwall@netlabs.com> | 1992-06-08 04:52:11 +0000 |
---|---|---|
committer | Larry Wall <lwall@netlabs.com> | 1992-06-08 04:52:11 +0000 |
commit | 32c2e4fbb7ba898d9e58e8d2292dd45b8692070d (patch) | |
tree | 9ad3885f2a4a8d28c3729e34af44b85e9ad124bf /lib | |
parent | 83025b217962b0369a18edad3fa14dc1087f3c2a (diff) | |
download | perl-32c2e4fbb7ba898d9e58e8d2292dd45b8692070d.tar.gz |
perl 4.0 patch 30: patch #20, continued
See patch #20.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pwd.pl | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/pwd.pl b/lib/pwd.pl index 09ba1d2041..89fc230ff2 100644 --- a/lib/pwd.pl +++ b/lib/pwd.pl @@ -1,8 +1,11 @@ ;# pwd.pl - keeps track of current working directory in PWD environment var ;# -;# $Header: pwd.pl,v 4.0 91/03/20 01:26:03 lwall Locked $ +;# $RCSfile: pwd.pl,v $$Revision: 4.0.1.1 $$Date: 92/06/08 13:45:22 $ ;# ;# $Log: pwd.pl,v $ +;# Revision 4.0.1.1 92/06/08 13:45:22 lwall +;# patch20: support added to pwd.pl to strip automounter crud +;# ;# Revision 4.0 91/03/20 01:26:03 lwall ;# 4.0 baseline. ;# @@ -25,9 +28,20 @@ sub main'initpwd { if ($ENV{'PWD'}) { local($dd,$di) = stat('.'); local($pd,$pi) = stat($ENV{'PWD'}); - return if $di == $pi && $dd == $pd; + if ($di != $pi || $dd != $pd) { + chop($ENV{'PWD'} = `pwd`); + } + } + else { + chop($ENV{'PWD'} = `pwd`); + } + if ($ENV{'PWD'} =~ m|(/[^/]+(/[^/]+/[^/]+))(.*)|) { + local($pd,$pi) = stat($2); + local($dd,$di) = stat($1); + if ($di == $pi && $dd == $pd) { + $ENV{'PWD'}="$2$3"; + } } - chop($ENV{'PWD'} = `pwd`); } sub main'chdir { |