diff options
author | tjr <tjr@FreeBSD.org> | 2002-06-30 06:02:39 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2002-06-30 06:02:39 +0000 |
commit | 5edd8af4905883c2a3482904f4eb90310801e9fc (patch) | |
tree | a5085e00af70c594b193357fcaa58ba77157bef8 | |
parent | 825f2f17f43dbf5db6626b09447d641658238f70 (diff) | |
download | FreeBSD-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
-rw-r--r-- | usr.bin/which/which.c | 2 |
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) { |