]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libsmartcols: fix scols_table_print_range() to print header
authorKarel Zak <kzak@redhat.com>
Mon, 22 Feb 2016 09:43:25 +0000 (10:43 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 22 Feb 2016 09:43:25 +0000 (10:43 +0100)
References: https://github.com/karelzak/util-linux/issues/287
Signed-off-by: Karel Zak <kzak@redhat.com>
libsmartcols/src/table_print.c

index f65cce38327bd07578d601e6a81cb926de26752a..d6622be64ec40c8c2b69891338a1bd79cad2ce7d 100644 (file)
@@ -1339,7 +1339,7 @@ int scols_table_print_range(      struct libscols_table *tb,
        } else
                scols_reset_iter(&itr, SCOLS_ITER_FORWARD);
 
-       if (itr.p == tb->tb_lines.next) {
+       if (!start || itr.p == tb->tb_lines.next) {
                rc = print_header(tb, buf);
                if (rc)
                        goto done;