[hackers] [sbase] which: Minor simplification || Michael Forney

From: <git_AT_suckless.org>
Date: Sat, 21 Oct 2017 21:57:39 +0200 (CEST)

commit 38cc01b8874900eab684d70847b8ca3a3e580a0f
Author: Michael Forney <mforney_AT_mforney.org>
AuthorDate: Fri Oct 20 22:26:30 2017 -0700
Commit: Michael Forney <mforney_AT_mforney.org>
CommitDate: Sat Oct 21 12:44:09 2017 -0700

    which: Minor simplification

diff --git a/which.c b/which.c
index 1e64452..cc93361 100644
--- a/which.c
+++ b/which.c
_AT_@ -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;
         }
Received on Sat Oct 21 2017 - 21:57:39 CEST

This archive was generated by hypermail 2.3.0 : Sat Oct 21 2017 - 22:00:46 CEST