diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2001-10-25 08:51:10 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2001-10-25 08:51:10 +0800 |
commit | e877791d816307b359d73732345f0e2164c49f4a (patch) | |
tree | 5bd2697dd4bd6c6d952ad8a3690c8580da790317 /mail/mail-format.c | |
parent | 0f9a7b1c32e4546e4990c40a27be55a8950e4c7c (diff) | |
download | gsoc2013-evolution-e877791d816307b359d73732345f0e2164c49f4a.tar.gz gsoc2013-evolution-e877791d816307b359d73732345f0e2164c49f4a.tar.zst gsoc2013-evolution-e877791d816307b359d73732345f0e2164c49f4a.zip |
Fix to not always return NULL for html parts, doh!.
2001-10-24 Jeffrey Stedfast <fejj@ximian.com>
* mail-format.c (mail_get_message_body): Fix to not always return
NULL for html parts, doh!.
svn path=/trunk/; revision=14081
Diffstat (limited to 'mail/mail-format.c')
-rw-r--r-- | mail/mail-format.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/mail/mail-format.c b/mail/mail-format.c index 1cb517d291..9b9dffb4fa 100644 --- a/mail/mail-format.c +++ b/mail/mail-format.c @@ -2245,11 +2245,10 @@ char * mail_get_message_body (CamelDataWrapper *data, gboolean want_plain, gboolean cite) { CamelContentType *mime_type; - CamelMultipart *mp; + char *subtext, *old, *div, *text = NULL; + GByteArray *bytes = NULL; CamelMimePart *subpart; - char *subtext, *old, *div; - char *text = NULL; - GByteArray *bytes; + CamelMultipart *mp; int i, nparts; mime_type = camel_data_wrapper_get_mime_type_field (data); @@ -2270,13 +2269,13 @@ mail_get_message_body (CamelDataWrapper *data, gboolean want_plain, gboolean cit if (header_content_type_is (mime_type, "text", "*") || header_content_type_is (mime_type, "message", "*")) { bytes = mail_format_get_data_wrapper_text (data, NULL); - if (bytes && !header_content_type_is (mime_type, "text", "html")) { + g_byte_array_append (bytes, "", 1); + text = bytes->data; + g_byte_array_free (bytes, FALSE); + + if (text && !header_content_type_is (mime_type, "text", "html")) { char *html; - g_byte_array_append (bytes, "", 1); - text = bytes->data; - g_byte_array_free (bytes, FALSE); - html = e_text_to_html (text, E_TEXT_TO_HTML_PRE | (cite ? E_TEXT_TO_HTML_CITE : 0)); g_free (text); text = html; @@ -2311,7 +2310,7 @@ mail_get_message_body (CamelDataWrapper *data, gboolean want_plain, gboolean cit div = "<br>\n----<br>\n<br>\n"; } else div = "<br><hr><br>"; - + nparts = camel_multipart_get_number (mp); for (i = 0; i < nparts; i++) { subpart = camel_multipart_get_part (mp, i); |