which: Minor simplification

This commit is contained in:
Michael Forney 2017-10-20 22:26:30 -07:00
parent 3b604b179c
commit 38cc01b887

View File

@ -50,12 +50,10 @@ which(const char *path, const char *name)
if (i && ptr[i - 1] != '/')
fputc('/', stdout);
puts(name);
if (!aflag) {
close(dirfd);
break;
}
}
close(dirfd);
if (!aflag && found)
break;
}
p = ptr + i + 1;
}