From 409614382714832673df753251de58a50aeda5bd Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 13 Nov 2023 14:39:04 +0100 Subject: [PATCH] mount-tool: rely on format-table.c's ersatz logic Let the table logic handle the special casing ov unavailable data, rather than doing that ourselves. --- src/mount/mount-tool.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mount/mount-tool.c b/src/mount/mount-tool.c index 29bde2ab8e0..53c11022673 100644 --- a/src/mount/mount-tool.c +++ b/src/mount/mount-tool.c @@ -1450,6 +1450,7 @@ static int list_devices(void) { return log_error_errno(r, "Failed to set sort index: %m"); table_set_header(table, arg_legend); + table_set_ersatz_string(table, TABLE_ERSATZ_DASH); FOREACH_DEVICE(e, d) { for (unsigned c = 0; c < _COLUMN_MAX; c++) { @@ -1486,7 +1487,7 @@ static int list_devices(void) { break; } - r = table_add_cell(table, NULL, c == COLUMN_NODE ? TABLE_PATH : TABLE_STRING, strna(x)); + r = table_add_cell(table, NULL, c == COLUMN_NODE ? TABLE_PATH : TABLE_STRING, x); if (r < 0) return table_log_add_error(r); } -- 2.39.5