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) {