Upgrade to Test::Harness 2.30.
[p5sagit/p5-mst-13.2.git] / lib / Cwd.pm
index 8b00543..baeb05c 100644 (file)
@@ -150,7 +150,7 @@ use strict;
 
 use Carp;
 
-our $VERSION = '2.06';
+our $VERSION = '2.07';
 
 use base qw/ Exporter /;
 our @EXPORT = qw(cwd getcwd fastcwd fastgetcwd);
@@ -192,7 +192,16 @@ foreach my $try (qw(/bin/pwd /usr/bin/pwd)) {
         last;
     }
 }
-$pwd_cmd ||= 'pwd';
+unless ($pwd_cmd) {
+    if (-x '/QOpenSys/bin/pwd') { # OS/400 PASE.
+        $pwd_cmd = '/QOpenSys/bin/pwd' ;
+    } else {
+        # Isn't this wrong?  _backtick_pwd() will fail if somenone has
+        # pwd in their path but it is not /bin/pwd or /usr/bin/pwd?
+        # See [perl #16774]. --jhi
+        $pwd_cmd = 'pwd';
+    }
+}
 
 # The 'natural and safe form' for UNIX (pwd may be setuid root)
 sub _backtick_pwd {
@@ -370,6 +379,7 @@ sub _perl_abs_path
     {
        $dotdots .= '/..';
        @pst = @cst;
+       local *PARENT;
        unless (opendir(PARENT, $dotdots))
        {
            carp "opendir($dotdots): $!";