which: Don't look for paths with slashes in $PATH

This commit is contained in:
Michael Forney 2017-10-20 12:31:27 -07:00
parent 44265b29ce
commit 3b604b179c

View File

@ -31,10 +31,10 @@ which(const char *path, const char *name)
int dirfd, found = 0;
if (strchr(name, '/')) {
if (canexec(AT_FDCWD, name)) {
found = canexec(AT_FDCWD, name);
if (found)
puts(name);
return 1;
}
return found;
}
ptr = p = enstrdup(3, path);