From d5577b64faab7a85af2844f3e38edb5df8e2393d Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 11 Jul 2010 11:07:48 +0000 Subject: Missing types svn path=/trunk/netsurf/; revision=10626 --- amiga/filetype.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'amiga/filetype.c') diff --git a/amiga/filetype.c b/amiga/filetype.c index bc742c579..dbb3f9981 100644 --- a/amiga/filetype.c +++ b/amiga/filetype.c @@ -36,8 +36,8 @@ const char *fetch_filetype(const char *unix_path) STRPTR ttype = NULL; struct DiskObject *dobj = NULL; BPTR lock = 0; - struct DataTypeHeader *dth = NULL; - struct DataType *dtn; + struct DataTypeHeader *dth = NULL; + struct DataType *dtn; BOOL found = FALSE; /* First try getting a tooltype "MIMETYPE" and use that as the MIME type. Will fail over @@ -71,17 +71,25 @@ const char *fetch_filetype(const char *unix_path) switch(dth->dth_GroupID) { case GID_SYSTEM: - sprintf(mimetype,"application/%s",dth->dth_BaseName); + if(strcmp("directory",dth->dth_BaseName)==0) + { + strcpy(mimetype,"application/x-netsurf-directory"); + } + else if(strcmp("binary",dth->dth_BaseName)==0) + { + strcpy(mimetype,"application/octet-stream"); + } + else sprintf(mimetype,"application/%s",dth->dth_BaseName); break; case GID_TEXT: case GID_DOCUMENT: if(strcmp("ascii",dth->dth_BaseName)==0) { - sprintf(mimetype,"text/plain",dth->dth_BaseName); + strcpy(mimetype,"text/plain"); } else if(strcmp("simplehtml",dth->dth_BaseName)==0) { - sprintf(mimetype,"text/html",dth->dth_BaseName); + strcpy(mimetype,"text/html"); } else { @@ -110,8 +118,6 @@ const char *fetch_filetype(const char *unix_path) if(!found) strcpy(mimetype,"text/html"); /* If all else fails */ - //printf("%s: %s\n",unix_path,mimetype); - return mimetype; } -- cgit v1.2.3