Skip to content

Commit

Permalink
lib-imap: Remove content_subtype==NULL checks
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
sirainen authored and cmouse committed Aug 7, 2018
1 parent 8ad6de3 commit cebf45d
Showing 1 changed file with 3 additions and 14 deletions.
17 changes: 3 additions & 14 deletions src/lib-imap/imap-bodystructure.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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\"");
}
}

Expand Down

0 comments on commit cebf45d

Please sign in to comment.