parallel: Fixed bug #43967: Error if there exists a bin/zsh or bin/bash dir (with zsh or bash).

This commit is contained in:
Ole Tange 2015-01-18 21:54:43 +01:00
parent 29ce26de3f
commit 38b214971e

View file

@ -3141,7 +3141,8 @@ sub which {
# @full_path = full paths to @programs. Nothing if not found
my @which;
for my $prg (@_) {
push @which, map { $_."/".$prg } grep { -x $_."/".$prg } split(":",$ENV{'PATH'});
push @which, grep { not -d $_ and -x $_ }
map { $_."/".$prg } split(":",$ENV{'PATH'});
}
return @which;
}