]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
whereis: fix missing newline on empty results
authorAndreas Henriksson <andreas@fatal.se>
Wed, 9 Jul 2014 12:09:34 +0000 (14:09 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 14 Jul 2014 13:49:27 +0000 (15:49 +0200)
Running "whereis foo.bar.quux" previously resulted in
printing the "foo.bar:" pattern prefix without any
newline following it.

Signed-off-by: Andreas Henriksson <andreas@fatal.se>
misc-utils/whereis.c

index ba83b159bdbd0a7b6e5dab9b710c5c46f6e1ea8a..dc7406b94bdf2a009a433c2d4d7c5698a4eecf09 100644 (file)
@@ -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;
 }