From: Karel Zak Date: Fri, 5 May 2017 11:56:40 +0000 (+0200) Subject: column: be robust on empty table X-Git-Tag: v2.30-rc1~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da06d421971d288078352bcff05e0bcc662b3a79;p=thirdparty%2Futil-linux.git column: be robust on empty table Signed-off-by: Karel Zak --- diff --git a/text-utils/column.c b/text-utils/column.c index cdfb233907..421823d4a1 100644 --- a/text-utils/column.c +++ b/text-utils/column.c @@ -749,8 +749,10 @@ int main(int argc, char **argv) switch (ctl.mode) { case COLUMN_MODE_TABLE: - modify_table(&ctl); - eval = scols_print_table(ctl.tab); + if (ctl.tab && scols_table_get_nlines(ctl.tab)) { + modify_table(&ctl); + eval = scols_print_table(ctl.tab); + } break; case COLUMN_MODE_FILLCOLS: columnate_fillcols(&ctl);