diff options
author | Milan Crha <mcrha@redhat.com> | 2009-10-16 01:27:04 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2009-10-16 01:27:04 +0800 |
commit | 781d9aad4d9083f4ae380901f7b52e8fd82bf2a4 (patch) | |
tree | 4cbdd1fca53fd4851d211e3a8da13d891f8c66b8 /em-format | |
parent | f2337c65d08897c204e05071abe7cc979e4d02b8 (diff) | |
download | gsoc2013-evolution-781d9aad4d9083f4ae380901f7b52e8fd82bf2a4.tar.gz gsoc2013-evolution-781d9aad4d9083f4ae380901f7b52e8fd82bf2a4.tar.zst gsoc2013-evolution-781d9aad4d9083f4ae380901f7b52e8fd82bf2a4.zip |
Bug #468736 - Prevent recursion in em-format
Diffstat (limited to 'em-format')
-rw-r--r-- | em-format/em-format.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/em-format/em-format.c b/em-format/em-format.c index 19423e90a7..a6b01f4b9a 100644 --- a/em-format/em-format.c +++ b/em-format/em-format.c @@ -645,6 +645,7 @@ em_format_part_as(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const g_free(basestr); if (mime_type != NULL) { + gboolean is_fallback = FALSE; if (g_ascii_strcasecmp(mime_type, "application/octet-stream") == 0) { emf->snoop_mime_type = mime_type = em_format_snoop_type(part); if (mime_type == NULL) @@ -652,13 +653,19 @@ em_format_part_as(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const } handle = em_format_find_handler(emf, mime_type); - if (handle == NULL) + if (handle == NULL) { handle = em_format_fallback_handler(emf, mime_type); + is_fallback = TRUE; + } if (handle != NULL && !em_format_is_attachment(emf, part)) { d(printf("running handler for type '%s'\n", mime_type)); + if (is_fallback) + camel_object_meta_set (part, "EMF-Fallback", "1"); handle->handler(emf, stream, part, handle); + if (is_fallback) + camel_object_meta_set (part, "EMF-Fallback", NULL); goto finish; } d(printf("this type is an attachment? '%s'\n", mime_type)); |