From: Timo Sirainen Date: Wed, 27 Aug 2025 06:50:05 +0000 (+0300) Subject: doveadm: Print table formatter - Print empty values as "-" X-Git-Tag: 2.4.2~473 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=29db1d09a8251e83a5d143588dd2c7dfe2f4b30a;p=thirdparty%2Fdovecot%2Fcore.git doveadm: Print table formatter - Print empty values as "-" It's more readable to see empty values as "-" in a table. --- diff --git a/src/doveadm/doveadm-print-table.c b/src/doveadm/doveadm-print-table.c index a666e6f49d..a8dd31e7c0 100644 --- a/src/doveadm/doveadm-print-table.c +++ b/src/doveadm/doveadm-print-table.c @@ -133,6 +133,11 @@ static void doveadm_print_next(const char *value) const struct doveadm_print_table_header *hdr; int value_padded_len; + if (value[0] == '\0') { + /* It's more readable to see empty values as "-" in a table */ + value = "-"; + } + hdr = array_idx(&ctx->headers, ctx->hdr_idx); value_padded_len = hdr->length + utf8_correction(value);