summaryrefslogtreecommitdiff
path: root/dist/PathTools
diff options
context:
space:
mode:
authorTony Cook <tony@develop-help.com>2021-05-04 14:55:50 +1000
committerTony Cook <tony@develop-help.com>2021-06-09 10:47:17 +1000
commit8d8a6cf5e433f410d4e17f0c9028364384f5915b (patch)
treeb6e9381938bd48065efec86f89e896083a8afb77 /dist/PathTools
parenta5823872283be23731f1bcde7e19a926c44b31a4 (diff)
downloadperl-8d8a6cf5e433f410d4e17f0c9028364384f5915b.tar.gz
remove code that assuming finding pwd on the path is reasonable
We deliberately clear PATH when invoking pwd, so this search is useless.
Diffstat (limited to 'dist/PathTools')
-rw-r--r--dist/PathTools/Cwd.pm14
1 files changed, 0 insertions, 14 deletions
diff --git a/dist/PathTools/Cwd.pm b/dist/PathTools/Cwd.pm
index c3df3199ba..d5bbb82d2e 100644
--- a/dist/PathTools/Cwd.pm
+++ b/dist/PathTools/Cwd.pm
@@ -213,20 +213,6 @@ sub _backtick_pwd {
# we take care not to override an existing definition for cwd().
unless ($METHOD_MAP{$^O}{cwd} or defined &cwd) {
- # The pwd command is not available in some chroot(2)'ed environments
- my $sep = $Config::Config{path_sep} || ':';
- my $os = $^O; # Protect $^O from tainting
-
-
- # Try again to find a pwd, this time searching the whole PATH.
- if (defined $ENV{PATH} and $os ne 'MSWin32') { # no pwd on Windows
- my @candidates = split($sep, $ENV{PATH});
- while (!$found_pwd_cmd and @candidates) {
- my $candidate = shift @candidates;
- $found_pwd_cmd = 1 if -x "$candidate/pwd";
- }
- }
-
if( $found_pwd_cmd )
{
*cwd = \&_backtick_pwd;