summaryrefslogtreecommitdiff
path: root/atari/filetype.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2014-05-19 17:28:59 +0100
committerMichael Drake <tlsa@netsurf-browser.org>2014-05-19 17:28:59 +0100
commit05087404da14b9e2150ca42a8918557ee4151c6c (patch)
tree3066c229f2fa0f27c9bf4636f8c3eb9255bcdcd7 /atari/filetype.c
parenta8fc41529f81be72b750bc54b3c91311ce14346d (diff)
downloadnetsurf-05087404da14b9e2150ca42a8918557ee4151c6c.tar.gz
netsurf-05087404da14b9e2150ca42a8918557ee4151c6c.tar.bz2
Fix line endings.
Diffstat (limited to 'atari/filetype.c')
-rwxr-xr-xatari/filetype.c110
1 files changed, 55 insertions, 55 deletions
diff --git a/atari/filetype.c b/atari/filetype.c
index 4ceff8030..13e6ebf9a 100755
--- a/atari/filetype.c
+++ b/atari/filetype.c
@@ -1,63 +1,63 @@
-/*
- * Copyright 2010 Ole Loots <ole@monochrom.net>
- *
- * This file is part of NetSurf, http://www.netsurf-browser.org/
- *
- * NetSurf is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
- *
- * NetSurf is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <sys/types.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include "utils/messages.h"
-#include "utils/utils.h"
-#include "utils/log.h"
-#include "content/fetch.h"
+/*
+ * Copyright 2010 Ole Loots <ole@monochrom.net>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * NetSurf is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <sys/types.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "utils/messages.h"
+#include "utils/utils.h"
+#include "utils/log.h"
+#include "content/fetch.h"
#include "atari/filetype.h"
-
-/**
- * filetype -- determine the MIME type of a local file
- */
-const char *fetch_filetype(const char *unix_path)
-{
+
+/**
+ * filetype -- determine the MIME type of a local file
+ */
+const char *fetch_filetype(const char *unix_path)
+{
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( strchr( unix_path, (int)'.' ) ){
- if (2 < l && strcasecmp(unix_path + l - 3, "f79") == 0)
- 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)
+ if( strchr( unix_path, (int)'.' ) ){
+ if (2 < l && strcasecmp(unix_path + l - 3, "f79") == 0)
+ 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";
} else {
int n=0;
@@ -85,8 +85,8 @@ const char *fetch_filetype(const char *unix_path)
}
}
}
-
+
error:
LOG(("mime type: %s", res ));
- return( res );
-}
+ return( res );
+}