libsmartcols: set minimal column width to 1
The default is to use header width or relative width setting as the minimal column width. The problem are columns where is no header or relative width. Let's set minimal width to 1 in this case. Addresses: https://github.com/karelzak/util-linux/pull/577 Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
19b10b8978
commit
0f9f927b6f
|
@ -1068,6 +1068,8 @@ static int count_column_width(struct libscols_table *tb,
|
|||
size_t len = mbs_safe_width(scols_cell_get_data(&cl->header));
|
||||
cl->width_min = max(cl->width_min, len);
|
||||
}
|
||||
if (!cl->width_min)
|
||||
cl->width_min = 1;
|
||||
}
|
||||
|
||||
scols_reset_iter(&itr, SCOLS_ITER_FORWARD);
|
||||
|
|
Loading…
Reference in New Issue