aboutsummaryrefslogtreecommitdiff
path: root/src/cookies.c
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2011-11-11 04:26:41 +0000
committercorvid <corvid@lavabit.com>2011-11-11 04:26:41 +0000
commit980fe05f47b9d6dd8626b5ea021e2c16807ff5ca (patch)
tree2e5670d74d8fcfb8e7f6b84ffaf5f77b74855746 /src/cookies.c
parent119aa95ed6bc612dd4ef7a3121d9bf220148aaa4 (diff)
locale-independent ASCII character case handling
Basically, I and i are different letters in Turkic languages, and this causes problems for str(n)casecmp and toupper/tolower in these locales when dillo is dealing with ASCII.
Diffstat (limited to 'src/cookies.c')
-rw-r--r--src/cookies.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/cookies.c b/src/cookies.c
index eadd0322..0a1e94ff 100644
--- a/src/cookies.c
+++ b/src/cookies.c
@@ -284,11 +284,11 @@ static int Cookie_control_init(void)
rule[j++] = line[i++];
rule[j] = '\0';
- if (dStrcasecmp(rule, "ACCEPT") == 0)
+ if (dStrAsciiCasecmp(rule, "ACCEPT") == 0)
cc.action = COOKIE_ACCEPT;
- else if (dStrcasecmp(rule, "ACCEPT_SESSION") == 0)
+ else if (dStrAsciiCasecmp(rule, "ACCEPT_SESSION") == 0)
cc.action = COOKIE_ACCEPT_SESSION;
- else if (dStrcasecmp(rule, "DENY") == 0)
+ else if (dStrAsciiCasecmp(rule, "DENY") == 0)
cc.action = COOKIE_DENY;
else {
MSG("Cookies: rule '%s' for domain '%s' is not recognised.\n",
@@ -297,7 +297,7 @@ static int Cookie_control_init(void)
}
cc.domain = dStrdup(domain);
- if (dStrcasecmp(cc.domain, "DEFAULT") == 0) {
+ if (dStrAsciiCasecmp(cc.domain, "DEFAULT") == 0) {
/* Set the default action */
default_action = cc.action;
dFree(cc.domain);
@@ -338,13 +338,13 @@ static CookieControlAction Cookies_control_check_domain(const char *domain)
if (ccontrol[i].domain[0] == '.') {
diff = strlen(domain) - strlen(ccontrol[i].domain);
if (diff >= 0) {
- if (dStrcasecmp(domain + diff, ccontrol[i].domain) != 0)
+ if (dStrAsciiCasecmp(domain + diff, ccontrol[i].domain) != 0)
continue;
} else {
continue;
}
} else {
- if (dStrcasecmp(domain, ccontrol[i].domain) != 0)
+ if (dStrAsciiCasecmp(domain, ccontrol[i].domain) != 0)
continue;
}