table: drop trailing white spaces of the last cell in row

Fixes #18415.
This commit is contained in:
Yu Watanabe
2021-02-19 14:04:32 +09:00
parent 1f3315b8bd
commit 71894e1831
2 changed files with 26 additions and 20 deletions
+6
View File
@@ -2258,6 +2258,12 @@ int table_print(Table *t, FILE *f) {
if (!aligned)
return -ENOMEM;
/* Drop trailing white spaces of last column when no cosmetics is set. */
if (j == display_columns - 1 &&
(!colors_enabled() || !table_data_color(d)) &&
(!urlify_enabled() || !d->url))
delete_trailing_chars(aligned, NULL);
free_and_replace(buffer, aligned);
field = buffer;
}