From 4930757c7636d8c3cf205639333147f948c1c44e Mon Sep 17 00:00:00 2001 From: Guillaume Morin Date: Sun, 30 Dec 2001 18:34:03 +0000 Subject: [PATCH] removed fastcwd --- stow.in | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/stow.in b/stow.in index 3fb852c..50e40d7 100644 --- a/stow.in +++ b/stow.in @@ -518,42 +518,6 @@ sub version { exit(0); } -# This is from Perl 4's fastcwd.pl, by John Bazik. -# -# Usage: $cwd = &fastcwd; -# -# This is a faster version of getcwd. It's also more dangerous -# because you might chdir out of a directory that you can't chdir back -# into. - -sub fastcwd { - local($odev, $oino, $cdev, $cino, $tdev, $tino); - local(@path, $path); - local(*DIR); - - ($cdev, $cino) = stat('.'); - for (;;) { - ($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 '..'; - - last unless $_; - ($tdev, $tino) = lstat($_); - last unless $tdev != $odev || $tino != $oino; - } - closedir(DIR); - unshift(@path, $_); - } - chdir($path = '/' . join('/', @path)); - $path; -} - # Local variables: # mode: perl # End: