Allow for directory named "0"
Perl 5 Porters [Tue, 14 May 1996 08:42:17 +0000 (08:42 +0000)]
lib/getcwd.pl

index 8db8e20..d886018 100644 (file)
@@ -54,7 +54,7 @@ sub getcwd
        }
        $cwd = "$dir/$cwd";
        closedir(getcwd'PARENT);                                        #');
-    } while ($dir);
+    } while ($dir ne '');
     chop($cwd);
     $cwd;
 }