summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xusr.bin/which/which.pl6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/which/which.pl b/usr.bin/which/which.pl
index 688eb6a..55214a6 100755
--- a/usr.bin/which/which.pl
+++ b/usr.bin/which/which.pl
@@ -24,7 +24,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $Id: which.pl,v 1.11 1997/08/26 11:13:39 charnier Exp $
+# $Id: which.pl,v 1.12 1998/01/02 13:46:25 helbig Exp $
$all = $silent = $found = 0;
@path = split(/:/, $ENV{'PATH'});
@@ -42,13 +42,13 @@ if ($ARGV[0] eq "-a") {
}
foreach $prog (@ARGV) {
- if ("$prog" =~ '/' && -x "$prog") {
+ if ("$prog" =~ '/' && -x "$prog" && -f "$prog") {
print "$prog\n" unless $silent;
$found = 1;
} else {
foreach $e (@path) {
$e = "." if !$e;
- if (-x "$e/$prog") {
+ if (-x "$e/$prog" && -f "$e/$prog") {
print "$e/$prog\n" unless $silent;
$found = 1;
last unless $all;
OpenPOWER on IntegriCloud