aboutsummaryrefslogtreecommitdiff
path: root/src/url.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/url.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/url.c')
-rw-r--r--src/url.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/url.c b/src/url.c
index 78f717cf..27c97d1c 100644
--- a/src/url.c
+++ b/src/url.c
@@ -54,7 +54,7 @@ static const char *HEX = "0123456789ABCDEF";
#define URL_STR_FIELD_CMP(s1,s2) \
(s1) && (s2) ? strcmp(s1,s2) : !(s1) && !(s2) ? 0 : (s1) ? 1 : -1
#define URL_STR_FIELD_I_CMP(s1,s2) \
- (s1) && (s2) ? dStrcasecmp(s1,s2) : !(s1) && !(s2) ? 0 : (s1) ? 1 : -1
+ (s1) && (s2) ? dStrAsciiCasecmp(s1,s2) : !(s1) && !(s2) ? 0 : (s1) ? 1 : -1
/*
* Return the url as a string.
@@ -702,7 +702,7 @@ static uint_t Url_host_public_internal_dots(const char *host)
for (i = 0; i < tld_num; i++) {
if (strlen(tlds[i]) == (uint_t) tld_len &&
- !dStrncasecmp(tlds[i], host + start, tld_len)) {
+ !dStrnAsciiCasecmp(tlds[i], host + start, tld_len)) {
_MSG("TLD code matched %s\n", tlds[i]);
ret++;
break;
@@ -759,6 +759,7 @@ bool_t a_Url_same_organization(const DilloUrl *u1, const DilloUrl *u2)
if (!u1 || !u2)
return FALSE;
- return dStrcasecmp(Url_host_find_public_suffix(URL_HOST(u1)),
- Url_host_find_public_suffix(URL_HOST(u2))) ? FALSE :TRUE;
+ return dStrAsciiCasecmp(Url_host_find_public_suffix(URL_HOST(u1)),
+ Url_host_find_public_suffix(URL_HOST(u2)))
+ ? FALSE : TRUE;
}