diff --git a/mailnews/mime/src/mimemalt.cpp b/mailnews/mime/src/mimemalt.cpp index 93a906333e35..da0af99c7f94 100644 --- a/mailnews/mime/src/mimemalt.cpp +++ b/mailnews/mime/src/mimemalt.cpp @@ -165,11 +165,10 @@ MimeMultipartAlternative_create_child(MimeObject *obj) } else { - /* If this part is not displayable, then we're done -- all that is left - to do is to flush out the part that is currently in the cache. + /* If this part is not displayable, then skip it. maybe the next one will be... */ - mult->state = MimeMultipartEpilogue; - return MimeMultipartAlternative_display_cached_part(obj); + mult->state = MimeMultipartSkipPartLine; + return 0; } } diff --git a/mailnews/mime/src/mimemult.cpp b/mailnews/mime/src/mimemult.cpp index d7640bb35181..595464b708a9 100644 --- a/mailnews/mime/src/mimemult.cpp +++ b/mailnews/mime/src/mimemult.cpp @@ -266,7 +266,7 @@ MimeMultipart_parse_line (char *line, PRInt32 length, MimeObject *obj) // If "multipart/alternative" or the first part is a message body // then we should check for a charset and notify the emitter // if one exists. - if (obj->options && (isAlternative || isBody)) + if (obj->options && ((isAlternative && mult->state != MimeMultipartSkipPartLine) || isBody)) { { char *ct = MimeHeaders_get(mult->hdrs, HEADER_CONTENT_TYPE, PR_FALSE, PR_FALSE); @@ -314,6 +314,10 @@ MimeMultipart_parse_line (char *line, PRInt32 length, MimeObject *obj) if (status < 0) return status; break; + case MimeMultipartSkipPartLine: + /* we are skipping that part, therefore just ignore the line */ + break; + default: PR_ASSERT(0); return -1; diff --git a/mailnews/mime/src/mimemult.h b/mailnews/mime/src/mimemult.h index eb74c900f00b..5dfd4a211ee5 100644 --- a/mailnews/mime/src/mimemult.h +++ b/mailnews/mime/src/mimemult.h @@ -93,6 +93,7 @@ typedef enum { MimeMultipartHeaders, MimeMultipartPartFirstLine, MimeMultipartPartLine, + MimeMultipartSkipPartLine, MimeMultipartEpilogue } MimeMultipartParseState;