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,13 +50,11 @@ which(const char *path, const char *name)
if (i && ptr[i - 1] != '/') if (i && ptr[i - 1] != '/')
fputc('/', stdout); fputc('/', stdout);
puts(name); puts(name);
if (!aflag) { }
close(dirfd); close(dirfd);
if (!aflag && found)
break; break;
} }
}
close(dirfd);
}
p = ptr + i + 1; p = ptr + i + 1;
} }
free(ptr); free(ptr);