From: Davidlohr Bueso <dave@gnu.org>
To: Karel Zak <kzak@redhat.com>
Cc: util-linux <util-linux@vger.kernel.org>
Subject: [PATCH] whereis: move token assignment into loop syntax
Date: Sun, 29 Jan 2012 15:25:24 +0100 [thread overview]
Message-ID: <1327847124.3305.1.camel@offbook> (raw)
From: Davidlohr Bueso <dave@gnu.org>
Date: Sun, 29 Jan 2012 15:22:41 +0100
We can save a few lines and use for() naturally instead.
Signed-off-by: Davidlohr Bueso <dave@gnu.org>
---
misc-utils/whereis.c | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/misc-utils/whereis.c b/misc-utils/whereis.c
index 925cc93..eee4bf6 100644
--- a/misc-utils/whereis.c
+++ b/misc-utils/whereis.c
@@ -268,11 +268,7 @@ static void fillpath(void)
return;
pathcp = xstrdup(path);
- for (tmp = pathcp; ; tmp = NULL) {
- tok = strtok_r(tmp, ":", &key);
- if (!tok)
- break;
-
+ for (tmp = pathcp; tok = strtok_r(tmp, ":", &key); tmp = NULL) {
/* make sure we don't repeat the search path */
if (inpath(tok))
continue;
--
1.7.4.1
next reply other threads:[~2012-01-29 14:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-29 14:25 Davidlohr Bueso [this message]
2012-01-30 9:08 ` [PATCH] whereis: move token assignment into loop syntax Voelker, Bernhard
2012-01-30 12:24 ` Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1327847124.3305.1.camel@offbook \
--to=dave@gnu.org \
--cc=kzak@redhat.com \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox