From: Timo Sirainen Date: Tue, 24 Jul 2018 12:00:19 +0000 (+0300) Subject: lib-imap: Remove content_subtype==NULL checks X-Git-Tag: 2.2.36.1~19 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5c398e9109ab8bc02d9439d865ba61d8a2adb127;p=thirdparty%2Fdovecot%2Fcore.git lib-imap: Remove content_subtype==NULL checks This can never happen after the previous commit. This also changes the BODYSTRUCTURE output for invalid Content-Types, but since they're invalid anyway it doesn't really matter what the output is. --- diff --git a/src/lib-imap/imap-bodystructure.c b/src/lib-imap/imap-bodystructure.c index 7a02292705..4357f8791a 100644 --- a/src/lib-imap/imap-bodystructure.c +++ b/src/lib-imap/imap-bodystructure.c @@ -128,10 +128,7 @@ static void part_write_body_multipart(const struct message_part *part, } str_append_c(str, ' '); - if (data->content_subtype != NULL) - imap_append_string(str, data->content_subtype); - else - str_append(str, "\"x-unknown\""); + imap_append_string(str, data->content_subtype); if (!extended) return; @@ -160,20 +157,12 @@ static void part_write_body(const struct message_part *part, /* "content type" "subtype" */ if (data->content_type == NULL) { text = TRUE; - str_append(str, "\"text\""); + str_append(str, "\"text\" \"plain\""); } else { text = (strcasecmp(data->content_type, "text") == 0); imap_append_string(str, data->content_type); - } - str_append_c(str, ' '); - - if (data->content_subtype != NULL) + str_append_c(str, ' '); imap_append_string(str, data->content_subtype); - else { - if (text) - str_append(str, "\"plain\""); - else - str_append(str, "\"unknown\""); } }