From 9763978157519cb0f3878fde23bcf7987698ed1e Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Wed, 11 Apr 2001 23:30:33 +0000 Subject: Only look for special pseudo-multipart-isms (binhex, uucode, old pgp, etc) * mail-format.c (handle_text_plain): Only look for special pseudo-multipart-isms (binhex, uucode, old pgp, etc) if the MIME type is really text/plain. Otherwise, since there's no handler for applciation/mac-binhex40, it gets sent to mail-identify.c, which thinks it's text/plain because it starts with English words, and so it gets sent back to the text/plain handler, which finds an embedded binhex part... svn path=/trunk/; revision=9260 --- mail/ChangeLog | 8 ++++++++ mail/mail-format.c | 10 +++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index b594aa5974..1b9d91bd21 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,5 +1,13 @@ 2001-04-11 Dan Winship + * mail-format.c (handle_text_plain): Only look for special + pseudo-multipart-isms (binhex, uucode, old pgp, etc) if the MIME + type is really text/plain. Otherwise, since there's no handler for + applciation/mac-binhex40, it gets sent to mail-identify.c, which + thinks it's text/plain because it starts with English words, and + so it gets sent back to the text/plain handler, which finds an + embedded binhex part... + * mail-callbacks.c (do_view_message): mark messages as seen when opening then in a separate window. diff --git a/mail/mail-format.c b/mail/mail-format.c index 53ba0dd57d..3ff74238f0 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -860,6 +860,7 @@ handle_text_plain (CamelMimePart *part, const char *mime_type, camel_medium_get_content_object (CAMEL_MEDIUM (part)); char *text, *p, *start; CamelContentType *type; + gboolean check_specials; const char *format; int i; @@ -875,8 +876,15 @@ handle_text_plain (CamelMimePart *part, const char *mime_type, mail_html_write (md->html, md->stream, "\n\n 
\n"); + /* Only look for binhex and stuff if this is real text/plain. + * (and not, say, application/mac-binhex40 that mail-identify + * has decided to call text/plain because it starts with English + * text...) + */ + check_specials = g_strcasecmp (mime_type, "text/plain") != 0; + p = text; - while (p) { + while (p && check_specials) { /* Look for special cases. */ for (i = 0; i < NSPECIALS; i++) { start = strstr (p, text_specials[i].start); -- cgit v1.2.3