From 58a26b2294dc9e73c8f94d669f07ce8c4aaf8da9 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Fri, 30 Sep 2011 16:27:36 +0200 Subject: [PATCH] mimeutils: deal with various zz-application/zz-winassoc-XXX mime types zz-application is not a valid media type, but unfortunately there are quite a few mime types out there in the form of zz-application/zz-winassoc-XXX This patch makes mimeutils deal with these in 2 different ways: 1) For the "popular" ones (doc and xls) simply accept them 2) For the others, advice the standard mime type for these files Signed-off-by: Hans de Goede --- src/mimeutils.c | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/mimeutils.c b/src/mimeutils.c index d4f5f42..003e71e 100644 --- a/src/mimeutils.c +++ b/src/mimeutils.c @@ -73,7 +73,11 @@ static const char *valid_exceptions_mime_types[] = { "message/rfc822", /* some multimedia mime type; it clearly doesn't respect the mime type rules, * but it's widely deployed */ - "misc/ultravox" + "misc/ultravox", + /* zz-application is not a valid media type, but these mime types are widely + * used, so some applications claim them for interoperability */ + "zz-application/zz-winassoc-doc", + "zz-application/zz-winassoc-xls", }; static struct { @@ -81,7 +85,15 @@ static struct { const char *should_be; } alias_to_replace_mime_types[] = { { "flv-application/octet-stream", "video/x-flv" }, - { "zz-application/zz-winassoc-cdr", "application/vnd.corel-draw" } + { "zz-application/zz-winassoc-123", "application/vnd.lotus-1-2-3" }, + { "zz-application/zz-winassoc-cab", "application/vnd.ms-cab-compressed" }, + { "zz-application/zz-winassoc-cdr", "application/vnd.corel-draw" }, + { "zz-application/zz-winassoc-hlp", "application/winhlp" }, + { "zz-application/zz-winassoc-ini", "text/plain" }, + { "zz-application/zz-winassoc-lwp", "application/vnd.lotus-wordpro" }, + { "zz-application/zz-winassoc-lzh", "application/x-lzh-compressed" }, + { "zz-application/zz-winassoc-mdb", "application/x-msaccess" }, + { "zz-application/zz-winassoc-uu", "text/x-uuencode" }, }; #define IF_IS_IN(list, type) \ -- 1.7.6.4