mirror of
https://github.com/moparisthebest/pacman
synced 2024-10-31 15:45:03 -04:00
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:
parent
dc339faf6a
commit
b275e5184e
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user