summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-07-29 18:36:59 +0200
committerLennart Poettering <lennart@poettering.net>2019-07-29 18:48:25 +0200
commit4ea710eaf44132fbc10634dad3a4ac1e24432b6a (patch)
treecba60a60860db013851939b847e728ad62ef82ad
parent7a9b4bb0507b815fa29eb8a19b50f0fcef93f39c (diff)
downloadsystemd-4ea710eaf44132fbc10634dad3a4ac1e24432b6a.tar.gz
format-table: if NULL is spcified as data, let's patch to an empty cell
This should make various calls easier that currently generate either an empty cell or a regular cell depending on whether they have data to show.
-rw-r--r--src/shared/format-table.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/shared/format-table.c b/src/shared/format-table.c
index 51ddd1ac51..d2764eebbd 100644
--- a/src/shared/format-table.c
+++ b/src/shared/format-table.c
@@ -356,6 +356,10 @@ int table_add_cell_full(
assert(type >= 0);
assert(type < _TABLE_DATA_TYPE_MAX);
+ /* Special rule: patch NULL data fields to the empty field */
+ if (!data)
+ type = TABLE_EMPTY;
+
/* Determine the cell adjacent to the current one, but one row up */
if (t->n_cells >= t->n_columns)
assert_se(p = t->data[t->n_cells - t->n_columns]);