]> git.notmuchmail.org Git - notmuch/commitdiff
notmuch show: Don't show empty headers.
authorCarl Worth <cworth@cworth.org>
Tue, 9 Mar 2010 18:12:58 +0000 (10:12 -0800)
committerCarl Worth <cworth@cworth.org>
Tue, 9 Mar 2010 18:12:58 +0000 (10:12 -0800)
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.

notmuch-show.c

index 36bb0d3085781a0ad0d4d7c529deb89489442ded..cb5e47aa9ed14e9e167010c6e3ec9576ff04f8e8 100644 (file)
@@ -160,7 +160,7 @@ format_headers_text (const void *ctx, notmuch_message_t *message)
     for (i = 0; i < ARRAY_SIZE (headers); i++) {
        name = headers[i];
        value = notmuch_message_get_header (message, name);
     for (i = 0; i < ARRAY_SIZE (headers); i++) {
        name = headers[i];
        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);
     }
 }