notmuch show: Don't show empty headers.

This is a fairly old regression. There has always been code to avoid
printing empty headers (such as Cc or Bcc with no values), but it has
been broken since notmuch_message_get_header was changed to return
an empty string rather than a NULL pointer for these fields.
This commit is contained in:
Carl Worth 2010-03-09 10:12:58 -08:00
parent c375f7a407
commit 2303d9366e

View file

@ -160,7 +160,7 @@ format_headers_text (const void *ctx, notmuch_message_t *message)
for (i = 0; i < ARRAY_SIZE (headers); i++) { for (i = 0; i < ARRAY_SIZE (headers); i++) {
name = headers[i]; name = headers[i];
value = notmuch_message_get_header (message, name); value = notmuch_message_get_header (message, name);
if (value) if (value && strlen (value))
printf ("%s: %s\n", name, value); printf ("%s: %s\n", name, value);
} }
} }