which: Don't look for paths with slashes in $PATH
This commit is contained in:
parent
44265b29ce
commit
3b604b179c
6
which.c
6
which.c
|
@ -31,10 +31,10 @@ which(const char *path, const char *name)
|
||||||
int dirfd, found = 0;
|
int dirfd, found = 0;
|
||||||
|
|
||||||
if (strchr(name, '/')) {
|
if (strchr(name, '/')) {
|
||||||
if (canexec(AT_FDCWD, name)) {
|
found = canexec(AT_FDCWD, name);
|
||||||
|
if (found)
|
||||||
puts(name);
|
puts(name);
|
||||||
return 1;
|
return found;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ptr = p = enstrdup(3, path);
|
ptr = p = enstrdup(3, path);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user