X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCwd.pm;h=b27e0888479c17f0c9b38e6771af8c097cc3b054;hb=40000a8c37c35cc00114329ca0add46bca36a0ec;hp=9aa57ecad481124ae979acfb117332c503d7f50c;hpb=fed7345c45910a20f6865d6a2f8978d09b352f41;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/Cwd.pm b/lib/Cwd.pm index 9aa57ec..b27e088 100644 --- a/lib/Cwd.pm +++ b/lib/Cwd.pm @@ -85,22 +85,23 @@ sub fastcwd { ($cdev, $cino) = stat('.'); for (;;) { + my $direntry; ($odev, $oino) = ($cdev, $cino); chdir('..'); ($cdev, $cino) = stat('.'); last if $odev == $cdev && $oino == $cino; opendir(DIR, '.'); for (;;) { - $_ = readdir(DIR); - next if $_ eq '.'; - next if $_ eq '..'; + $direntry = readdir(DIR); + next if $direntry eq '.'; + next if $direntry eq '..'; - last unless defined; - ($tdev, $tino) = lstat($_); + last unless defined $direntry; + ($tdev, $tino) = lstat($direntry); last unless $tdev != $odev || $tino != $oino; } closedir(DIR); - unshift(@path, $_); + unshift(@path, $direntry); } chdir($path = '/' . join('/', @path)); $path;