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 <andrew.gregory.8@gmail.com>
This commit is contained in:
Andrew Gregory 2014-02-08 10:25:51 -05:00 committed by Allan McRae
parent dc339faf6a
commit b275e5184e
1 changed files with 1 additions and 1 deletions

View File

@ -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;