summaryrefslogtreecommitdiffstats
path: root/usr.bin/which
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2002-06-30 06:02:39 +0000
committertjr <tjr@FreeBSD.org>2002-06-30 06:02:39 +0000
commit5edd8af4905883c2a3482904f4eb90310801e9fc (patch)
treea5085e00af70c594b193357fcaa58ba77157bef8 /usr.bin/which
parent825f2f17f43dbf5db6626b09447d641658238f70 (diff)
downloadFreeBSD-src-5edd8af4905883c2a3482904f4eb90310801e9fc.zip
FreeBSD-src-5edd8af4905883c2a3482904f4eb90310801e9fc.tar.gz
Handle relative and absolute pathnames (anything with a `/' in it) in the same
way as execve(2), and the old perl which(1). PR: 35718
Diffstat (limited to 'usr.bin/which')
-rw-r--r--usr.bin/which/which.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/which/which.c b/usr.bin/which/which.c
index 11f43fc..c3cccfc 100644
--- a/usr.bin/which/which.c
+++ b/usr.bin/which/which.c
@@ -129,7 +129,7 @@ print_matches(char *path, char *filename)
const char *d;
int found;
- if (*filename == '/')
+ if (strchr(filename, '/') != NULL)
return (is_there(filename) ? 0 : -1);
found = 0;
while ((d = strsep(&path, ":")) != NULL) {
OpenPOWER on IntegriCloud