diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2004-03-21 21:32:15 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2004-03-21 21:32:15 +0000 |
commit | 7e922c290f8ab3a4f72608da661428f573459e39 (patch) | |
tree | 634ba4c2cca135353c35bd29ac94691717551f1e /riscos/filetype.c | |
parent | 3aeafecd7b547e3f535fb5a700fc20e590dab967 (diff) | |
download | netsurf-7e922c290f8ab3a4f72608da661428f573459e39.tar.gz netsurf-7e922c290f8ab3a4f72608da661428f573459e39.tar.bz2 |
[project @ 2004-03-21 21:32:15 by jmb]
Fix for SparkFS causing problems with uploading zip files.
Map filetypes to mimetype properly.
svn path=/import/netsurf/; revision=646
Diffstat (limited to 'riscos/filetype.c')
-rw-r--r-- | riscos/filetype.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/riscos/filetype.c b/riscos/filetype.c index 0273558cb..4a4a9c92d 100644 --- a/riscos/filetype.c +++ b/riscos/filetype.c @@ -76,6 +76,22 @@ const char *fetch_filetype(const char *unix_path) } +char *fetch_mimetype(const char *ro_path) { + + os_error *e; + bits filetype; + char *mime = xcalloc(256, sizeof(char)); + + e = xosfile_read_stamped_no_path(ro_path, 0, 0, 0, 0, 0, &filetype); + if (e) return 0; + + e = xmimemaptranslate_filetype_to_mime_type(filetype, mime); + if (e) return 0; + + return mime; +} + + int cmp_type(const void *x, const void *y) { const bits *p = x; |