public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] whereis: move token assignment into loop syntax
@ 2012-01-29 14:25 Davidlohr Bueso
  2012-01-30  9:08 ` Voelker, Bernhard
  0 siblings, 1 reply; 3+ messages in thread
From: Davidlohr Bueso @ 2012-01-29 14:25 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux

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




^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-01-30 12:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-29 14:25 [PATCH] whereis: move token assignment into loop syntax Davidlohr Bueso
2012-01-30  9:08 ` Voelker, Bernhard
2012-01-30 12:24   ` Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox