mirror of
https://git.FreeBSD.org/src.git
synced 2025-02-08 06:02:59 +00:00
Submitted by: Torbjorn Granlund <tege@matematik.su.se>
* /usr/bin/which doesn't work if a complete path is passed to it. This is incompatible with other flavours of Unix, Here is a suggested patch:
This commit is contained in:
parent
e7a7980c25
commit
75f2898f9a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=9809
@ -31,7 +31,7 @@
|
||||
#
|
||||
# [whew!]
|
||||
#
|
||||
# $Id: which.pl,v 1.3 1995/01/30 17:49:19 asami Exp $
|
||||
# $Id: which.pl,v 1.4 1995/01/30 22:21:29 jkh Exp $
|
||||
|
||||
$all = 0;
|
||||
$silent = 0;
|
||||
@ -47,13 +47,18 @@ if ($ARGV[0] eq "-a") {
|
||||
}
|
||||
|
||||
foreach $prog (@ARGV) {
|
||||
foreach $e (@path) {
|
||||
if (-x "$e/$prog") {
|
||||
print "$e/$prog\n" unless $silent;
|
||||
if (-x "$prog") {
|
||||
print "$prog\n" unless $silent;
|
||||
$found = 1;
|
||||
last unless $all;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
foreach $e (@path) {
|
||||
if (-x "$e/$prog") {
|
||||
print "$e/$prog\n" unless $silent;
|
||||
$found = 1;
|
||||
last unless $all;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
exit (!$found);
|
||||
|
Loading…
x
Reference in New Issue
Block a user