]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm: Print table formatter - Print empty values as "-"
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 27 Aug 2025 06:50:05 +0000 (09:50 +0300)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Wed, 27 Aug 2025 19:15:18 +0000 (19:15 +0000)
It's more readable to see empty values as "-" in a table.

src/doveadm/doveadm-print-table.c

index a666e6f49d54965615ee1c14398431a5f949d0f9..a8dd31e7c0254ca802c43d34f2a3f47ee63290d0 100644 (file)
@@ -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);