]> err.no Git - util-linux/commitdiff
lib: tt.c: don't print header for empty table
authorKarel Zak <kzak@redhat.com>
Thu, 8 Apr 2010 12:56:49 +0000 (14:56 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 3 Jun 2010 13:20:12 +0000 (15:20 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/tt.c

index e33d63210fad47b59ddd23c6c8d70c6239b47e27..cd65197090fbd0bd86ade060c1e4e2cc6462d64a 100644 (file)
--- a/lib/tt.c
+++ b/lib/tt.c
@@ -541,7 +541,7 @@ static void print_header(struct tt *tb, char *buf, size_t bufsz)
 {
        struct list_head *p;
 
-       if (tb->flags & TT_FL_NOHEADINGS)
+       if ((tb->flags & TT_FL_NOHEADINGS) || list_empty(&tb->tb_lines))
                return;
 
        /* set width according to the size of data