summaryrefslogtreecommitdiff
path: root/atari
diff options
context:
space:
mode:
authorOle Loots <ole@monochrom.net>2011-11-23 22:35:40 +0000
committerOle Loots <ole@monochrom.net>2011-11-23 22:35:40 +0000
commit01666a444f94b4eb366720cac3c4d8c2ab049364 (patch)
treeee57bd9c501cc3119319aa89aaec4e8b56983ca3 /atari
parent6227acbd5016cc766bba7b3d51ac41c558d61aa8 (diff)
downloadnetsurf-01666a444f94b4eb366720cac3c4d8c2ab049364.tar.gz
netsurf-01666a444f94b4eb366720cac3c4d8c2ab049364.tar.bz2
Log mimetype
svn path=/trunk/netsurf/; revision=13173
Diffstat (limited to 'atari')
-rwxr-xr-xatari/filetype.c52
1 files changed, 28 insertions, 24 deletions
diff --git a/atari/filetype.c b/atari/filetype.c
index e21f33c54..dd7179cbc 100755
--- a/atari/filetype.c
+++ b/atari/filetype.c
@@ -27,39 +27,43 @@
#include "utils/log.h"
#include "content/fetch.h"
-
/**
* filetype -- determine the MIME type of a local file
*/
const char *fetch_filetype(const char *unix_path)
{
- int l;
- LOG(("unix path %s", unix_path));
- l = strlen(unix_path);
- /* This line is adding for devlopment versions running from the root dir: */
+ int l;
+ char * res = (char*)"text/html";
+ l = strlen(unix_path);
+
+ LOG(("unix path: %s", unix_path));
+
+ /* This line is added for devlopment versions running from the root dir: */
if (2 < l && strcasecmp(unix_path + l - 3, "f79") == 0)
- return "text/css";
- if (2 < l && strcasecmp(unix_path + l - 3, "css") == 0)
- return "text/css";
- if (2 < l && strcasecmp(unix_path + l - 3, "jpg") == 0)
- return "image/jpeg";
- if (3 < l && strcasecmp(unix_path + l - 4, "jpeg") == 0)
- return "image/jpeg";
- if (2 < l && strcasecmp(unix_path + l - 3, "gif") == 0)
- return "image/gif";
- if (2 < l && strcasecmp(unix_path + l - 3, "png") == 0)
- return "image/png";
- if (2 < l && strcasecmp(unix_path + l - 3, "jng") == 0)
- return "image/jng";
- if (2 < l && strcasecmp(unix_path + l - 3, "svg") == 0)
- return "image/svg";
- if (2 < l && strcasecmp(unix_path + l - 3, "txt") == 0)
- return "text/plain";
- return "text/html";
+ res = (char*)"text/css";
+ else if (2 < l && strcasecmp(unix_path + l - 3, "css") == 0)
+ res = (char*)"text/css";
+ else if (2 < l && strcasecmp(unix_path + l - 3, "jpg") == 0)
+ res = (char*)"image/jpeg";
+ else if (3 < l && strcasecmp(unix_path + l - 4, "jpeg") == 0)
+ res = (char*)"image/jpeg";
+ else if (2 < l && strcasecmp(unix_path + l - 3, "gif") == 0)
+ res = (char*)"image/gif";
+ else if (2 < l && strcasecmp(unix_path + l - 3, "png") == 0)
+ res = (char*)"image/png";
+ else if (2 < l && strcasecmp(unix_path + l - 3, "jng") == 0)
+ res = (char*)"image/jng";
+ else if (2 < l && strcasecmp(unix_path + l - 3, "svg") == 0)
+ res = (char*)"image/svg";
+ else if (2 < l && strcasecmp(unix_path + l - 3, "txt") == 0)
+ res = (char*)"text/plain";
+error:
+ LOG(("mime type: %s", res ));
+ return( res );
}
char *fetch_mimetype(const char *ro_path)
{
return strdup("text/plain");
-} \ No newline at end of file
+}