From b275e5184ef1acc3f8dd4a02131149a9b58a5828 Mon Sep 17 00:00:00 2001 From: Andrew Gregory Date: Sat, 8 Feb 2014 10:25:51 -0500 Subject: table_display: only check width when non-zero A width of 0 indicates that either pacman is not attached to a tty or the user does not want line wrapping. Either way pacman should not fall back to the basic display. Signed-off-by: Andrew Gregory --- src/pacman/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/pacman/util.c b/src/pacman/util.c index 3f2ed83b..36f4414a 100644 --- a/src/pacman/util.c +++ b/src/pacman/util.c @@ -640,7 +640,7 @@ static int table_display(const alpm_list_t *header, totalwidth = table_calc_widths(first, rows, padding, totalcols, &widths, &has_data); /* return -1 if terminal is not wide enough */ - if(totalwidth > cols) { + if(cols && totalwidth > cols) { pm_printf(ALPM_LOG_WARNING, _("insufficient columns available for table display\n")); ret = -1; -- cgit v1.2.3-24-g4f1b