From: Lennart Poettering Date: Mon, 13 Nov 2023 13:39:04 +0000 (+0100) Subject: mount-tool: rely on format-table.c's ersatz logic X-Git-Tag: v255-rc2~26^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=409614382714832673df753251de58a50aeda5bd;p=thirdparty%2Fsystemd.git 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. --- 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); }