]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
format-table: don't suppress trailing whitespace in first line
authorLennart Poettering <lennart@poettering.net>
Wed, 24 Feb 2021 17:54:32 +0000 (18:54 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 25 Feb 2021 07:31:25 +0000 (16:31 +0900)
We underline the first line, hence we shouldn't suppress the whitespace,
otherwise the line will end early.

Follow-up for: 71894e18313e41a72cecdc77fea5037f95d6903f

src/shared/format-table.c

index 77e3e7ccec965ab07f6f42be25a32b34dbdd50cf..8aaa9ccfa415bcbb10d4f6909799683db401cda3 100644 (file)
@@ -2260,7 +2260,7 @@ int table_print(Table *t, FILE *f) {
 
                                                 /* Drop trailing white spaces of last column when no cosmetics is set. */
                                                 if (j == display_columns - 1 &&
-                                                    (!colors_enabled() || !table_data_color(d)) &&
+                                                    (!colors_enabled() || (!table_data_color(d) && row != t->data)) &&
                                                     (!urlify_enabled() || !d->url))
                                                         delete_trailing_chars(aligned, NULL);