summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2004-03-21 22:31:30 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2004-03-21 22:31:30 +0000
commitdc642bc3fa1895e01aa970cdd45f1610e4ad6de9 (patch)
tree3720dd82377d29c5db78914b7e01199518e6bf9c
parent7e922c290f8ab3a4f72608da661428f573459e39 (diff)
downloadnetsurf-dc642bc3fa1895e01aa970cdd45f1610e4ad6de9.tar.gz
netsurf-dc642bc3fa1895e01aa970cdd45f1610e4ad6de9.tar.bz2
[project @ 2004-03-21 22:31:30 by jmb]
Fix mimetype reading for files used by image filingsystems. svn path=/import/netsurf/; revision=647
-rw-r--r--riscos/filetype.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/riscos/filetype.c b/riscos/filetype.c
index 4a4a9c92d..c5bd20a1b 100644
--- a/riscos/filetype.c
+++ b/riscos/filetype.c
@@ -79,12 +79,22 @@ const char *fetch_filetype(const char *unix_path)
char *fetch_mimetype(const char *ro_path) {
os_error *e;
- bits filetype;
+ bits filetype = 0, load;
+ int objtype;
char *mime = xcalloc(256, sizeof(char));
- e = xosfile_read_stamped_no_path(ro_path, 0, 0, 0, 0, 0, &filetype);
+ e = xosfile_read_no_path(ro_path, &objtype, &load, 0, 0, 0);
if (e) return 0;
+ if (objtype == 0x2) return 0; /* directories are pointless */
+
+ if ((load >> 20) & 0xFFF) {
+ filetype = (load>>8) & 0x000FFF;
+ }
+ else {
+ return 0; /* no idea */
+ }
+
e = xmimemaptranslate_filetype_to_mime_type(filetype, mime);
if (e) return 0;