From da449e4daccb7d800398d5b350d50bea87df2c4c Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Mon, 1 Oct 2001 18:23:05 +0000 Subject: if gnome-vfs returns application/octet-stream with the magic check, use 2001-10-01 Larry Ewing * mail-identify.c (mail_identify_mime_part): if gnome-vfs returns application/octet-stream with the magic check, use the filename check instead since it at least has a chance of being useful. svn path=/trunk/; revision=13265 --- mail/ChangeLog | 6 ++++++ mail/mail-identify.c | 22 +++++++++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index 974b112950..96036df76f 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,9 @@ +2001-10-01 Larry Ewing + + * mail-identify.c (mail_identify_mime_part): if gnome-vfs returns + application/octet-stream with the magic check, use the filename + check instead since it at least has a chance of being useful. + 2001-09-28 Dan Winship * folder-browser-ui.c (fbui_sensitize_timeout): wrap a diff --git a/mail/mail-identify.c b/mail/mail-identify.c index e3a0eefb14..5d0b5f1a69 100644 --- a/mail/mail-identify.c +++ b/mail/mail-identify.c @@ -66,13 +66,21 @@ mail_identify_mime_part (CamelMimePart *part, MailDisplay *md) if (!camel_data_wrapper_is_offline (data)) magic_type = identify_by_magic (data, md); - /* If GNOME-VFS doesn't recognize the data by magic, but it - * contains English words, it will call it text/plain. If the - * filename-based check came up with something different, use - * that instead. - */ - if (magic_type && name_type && !strcmp (magic_type, "text/plain")) - return g_strdup (name_type); + if (magic_type && name_type) { + /* If GNOME-VFS doesn't recognize the data by magic, but it + * contains English words, it will call it text/plain. If the + * filename-based check came up with something different, use + * that instead. + */ + if (!strcmp (magic_type, "text/plain")) + return g_strdup (name_type); + + /* If if returns "application/octet-stream" try to + * do better with the filename check. + */ + if (!strcmp (magic_type, "application/octet-stream")) + return g_strdup (name_type); + } /* If the MIME part data was online, and the magic check * returned something, use that, since it's more reliable. -- cgit v1.2.3