aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/which/which.c
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2002-06-30 06:02:39 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2002-06-30 06:02:39 +0000
commit721da592c44f0d3dd15f465d406f27cbe71e465a (patch)
treea5085e00af70c594b193357fcaa58ba77157bef8 /usr.bin/which/which.c
parent8c821782f8ae62a05cccbb092a3fa8730d4a0bdb (diff)
downloadsrc-721da592c44f0d3dd15f465d406f27cbe71e465a.tar.gz
src-721da592c44f0d3dd15f465d406f27cbe71e465a.zip
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
Notes
Notes: svn path=/head/; revision=99120
Diffstat (limited to 'usr.bin/which/which.c')
-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 11f43fcb700f..c3cccfcfc0fd 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) {