diff options
author | Ole Loots <ole@monochrom.net> | 2013-01-31 19:28:26 +0100 |
---|---|---|
committer | Ole Loots <ole@monochrom.net> | 2013-01-31 19:28:26 +0100 |
commit | 0703404654d2a40cacae2d94c6e0e22ca28b4acf (patch) | |
tree | bfdbe1e8952814f73a6b0e190ae0a77fd0cfc7bd /riscos/filetype.c | |
parent | 54f719aa960159c5b1978846223732c9669ca7fa (diff) | |
parent | 89856f55929907642013e45435b9d18cd1fafe36 (diff) | |
download | netsurf-mono/removing-windom-dependency.tar.gz netsurf-mono/removing-windom-dependency.tar.bz2 |
Merge branch 'master' into mono/removing-windom-dependencymono/removing-windom-dependency
Conflicts:
atari/toolbar.c
Diffstat (limited to 'riscos/filetype.c')
-rw-r--r-- | riscos/filetype.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/riscos/filetype.c b/riscos/filetype.c index ec15b3655..529f867ab 100644 --- a/riscos/filetype.c +++ b/riscos/filetype.c @@ -305,9 +305,21 @@ int ro_content_native_type(hlcache_handle *c) */ int ro_content_filetype_from_mime_type(lwc_string *mime_type) { - int file_type; + int file_type, index; os_error *error; + /* Search internal type map */ + for (index = TYPE_MAP_COUNT; index > 0; index--) { + const struct type_entry *e = &type_map[index - 1]; + + if (strlen(e->mime_type) == lwc_string_length(mime_type) && + strncasecmp(e->mime_type, + lwc_string_data(mime_type), + lwc_string_length(mime_type)) == 0) + return e->file_type; + } + + /* Ask MimeMap module */ error = xmimemaptranslate_mime_type_to_filetype( lwc_string_data(mime_type), (bits *) &file_type); if (error) |