From 980fe05f47b9d6dd8626b5ea021e2c16807ff5ca Mon Sep 17 00:00:00 2001 From: corvid Date: Fri, 11 Nov 2011 04:26:41 +0000 Subject: 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. --- src/cookies.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/cookies.c') 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; } -- cgit v1.2.3