aboutsummaryrefslogtreecommitdiff
path: root/src/cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cache.c')
-rw-r--r--src/cache.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/cache.c b/src/cache.c
index 15869ac6..11c7faf3 100644
--- a/src/cache.c
+++ b/src/cache.c
@@ -13,7 +13,6 @@
* Dillo's cache module
*/
-#include <ctype.h> /* for tolower */
#include <sys/types.h>
#include <stdlib.h>
@@ -521,7 +520,7 @@ const char *a_Cache_set_content_type(const DilloUrl *url, const char *ctype,
/* META only gives charset; use detected MIME type too */
entry->TypeNorm = dStrconcat(entry->TypeDet, ctype, NULL);
} else if (*from == 'm' &&
- !dStrncasecmp(ctype, "text/xhtml", 10)) {
+ !dStrnAsciiCasecmp(ctype, "text/xhtml", 10)) {
/* WORKAROUND: doxygen uses "text/xhtml" in META */
entry->TypeNorm = dStrdup(entry->TypeDet);
}
@@ -584,7 +583,7 @@ static char *Cache_parse_field(const char *header, const char *fieldname)
for (i = 0; header[i]; i++) {
/* Search fieldname */
for (j = 0; fieldname[j]; j++)
- if (tolower(fieldname[j]) != tolower(header[i + j]))
+ if (D_ASCII_TOLOWER(fieldname[j]) != D_ASCII_TOLOWER(header[i + j]))
break;
if (fieldname[j]) {
/* skip to next line */
@@ -620,7 +619,7 @@ static Dlist *Cache_parse_multiple_fields(const char *header,
for (i = 0; header[i]; i++) {
/* Search fieldname */
for (j = 0; fieldname[j]; j++)
- if (tolower(fieldname[j]) != tolower(header[i + j]))
+ if (D_ASCII_TOLOWER(fieldname[j]) != D_ASCII_TOLOWER(header[i + j]))
break;
if (fieldname[j]) {
/* skip to next line */
@@ -694,8 +693,8 @@ static void Cache_parse_header(CacheEntry_t *entry)
entry->Flags |= CA_TempRedirect; /* 302 Temporary Redirect */
if (URL_FLAGS(location_url) & (URL_Post + URL_Get) &&
- dStrcasecmp(URL_SCHEME(location_url), "dpi") == 0 &&
- dStrcasecmp(URL_SCHEME(entry->Url), "dpi") != 0) {
+ dStrAsciiCasecmp(URL_SCHEME(location_url), "dpi") == 0 &&
+ dStrAsciiCasecmp(URL_SCHEME(entry->Url), "dpi") != 0) {
/* Forbid dpi GET and POST from non dpi-generated urls */
MSG("Redirection Denied! '%s' -> '%s'\n",
URL_STR(entry->Url), URL_STR(location_url));
@@ -734,7 +733,7 @@ static void Cache_parse_header(CacheEntry_t *entry)
* If Transfer-Encoding is present, Content-Length must be ignored.
* If the Transfer-Encoding is non-identity, it is an error.
*/
- if (dStrcasecmp(encoding, "identity"))
+ if (dStrAsciiCasecmp(encoding, "identity"))
MSG_HTTP("Content-Length and non-identity Transfer-Encoding "
"headers both present.\n");
} else {
@@ -1045,9 +1044,9 @@ static void Cache_auth_entry(CacheEntry_t *entry, BrowserWindow *bw)
*/
int a_Cache_download_enabled(const DilloUrl *url)
{
- if (!dStrcasecmp(URL_SCHEME(url), "http") ||
- !dStrcasecmp(URL_SCHEME(url), "https") ||
- !dStrcasecmp(URL_SCHEME(url), "ftp"))
+ if (!dStrAsciiCasecmp(URL_SCHEME(url), "http") ||
+ !dStrAsciiCasecmp(URL_SCHEME(url), "https") ||
+ !dStrAsciiCasecmp(URL_SCHEME(url), "ftp"))
return 1;
return 0;
}