From: Andreas Henriksson Date: Wed, 9 Jul 2014 12:09:34 +0000 (+0200) Subject: whereis: fix missing newline on empty results X-Git-Tag: v2.25~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a112182134f300775d10d580a0ee9fa2bad0a13;p=thirdparty%2Futil-linux.git whereis: fix missing newline on empty results Running "whereis foo.bar.quux" previously resulted in printing the "foo.bar:" pattern prefix without any newline following it. Signed-off-by: Andreas Henriksson --- diff --git a/misc-utils/whereis.c b/misc-utils/whereis.c index ba83b159bd..dc7406b94b 100644 --- a/misc-utils/whereis.c +++ b/misc-utils/whereis.c @@ -430,7 +430,7 @@ static void lookup(const char *pattern, struct wh_dirlist *ls, int want) free(wait); - if ((count && !uflag) || (uflag && count > 1)) + if (!uflag || (uflag && count > 1)) putchar('\n'); return; }