summaryrefslogtreecommitdiff
path: root/lib/Cwd.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Cwd.pm')
-rw-r--r--lib/Cwd.pm11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/Cwd.pm b/lib/Cwd.pm
index 8b00543e1e..7f8ef6543b 100644
--- a/lib/Cwd.pm
+++ b/lib/Cwd.pm
@@ -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 {