Mercurial > dovecot > core-2.2
changeset 22986:7009c54d937f
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.
author | Timo Sirainen <timo.sirainen@dovecot.fi> |
---|---|
date | Tue, 24 Jul 2018 15:00:19 +0300 |
parents | e4a91ec695bb |
children | 1611d0ce5001 |
files | src/lib-imap/imap-bodystructure.c |
diffstat | 1 files changed, 3 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-imap/imap-bodystructure.c Tue Jul 24 14:55:25 2018 +0300 +++ b/src/lib-imap/imap-bodystructure.c Tue Jul 24 15:00:19 2018 +0300 @@ -128,10 +128,7 @@ } 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 @@ /* "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\""); } }