summaryrefslogtreecommitdiff
path: root/amiga/filetype.c
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2010-07-11 11:07:48 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2010-07-11 11:07:48 +0000
commitd5577b64faab7a85af2844f3e38edb5df8e2393d (patch)
tree99d29f55f846449046cd6e9ba1f8f3a71b78ff49 /amiga/filetype.c
parent693094ced482884959969201c8c257dafaa026b3 (diff)
downloadnetsurf-d5577b64faab7a85af2844f3e38edb5df8e2393d.tar.gz
netsurf-d5577b64faab7a85af2844f3e38edb5df8e2393d.tar.bz2
Missing types
svn path=/trunk/netsurf/; revision=10626
Diffstat (limited to 'amiga/filetype.c')
-rw-r--r--amiga/filetype.c20
1 files changed, 13 insertions, 7 deletions
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;
}