summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2009-08-06 15:08:11 +0200
committerSebastien Helleu <flashcode@flashtux.org>2009-08-06 15:08:11 +0200
commit859f6db87bacc38f0929bc64f44aa8501f361c5b (patch)
tree2d4b8f77227ff21018332755fae64862b455fd1d /src
parentacef1477751c71c078df10891a1a0124f46b79e6 (diff)
downloadweechat-859f6db87bacc38f0929bc64f44aa8501f361c5b.zip
Fix bug when comparing chars and ignoring case (with some locales) (bug #27190)
There was a problem with some locales like turkish, where upper "i" is "İ". All IRC commands with "I" inside (JOIN, PRIVMSG, ..) failed with turkish locale.
Diffstat (limited to 'src')
-rw-r--r--src/core/wee-utf8.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/wee-utf8.c b/src/core/wee-utf8.c
index 9e43bce58..c07fddb19 100644
--- a/src/core/wee-utf8.c
+++ b/src/core/wee-utf8.c
@@ -457,10 +457,12 @@ utf8_charcasecmp (const char *string1, const char *string2)
return (string1) ? 1 : ((string2) ? -1 : 0);
wchar1 = utf8_wide_char (string1);
- wchar1 = towlower (wchar1);
+ if ((wchar1 >= 'A') && (wchar1 <= 'Z'))
+ wchar1 += ('a' - 'A');
wchar2 = utf8_wide_char (string2);
- wchar2 = towlower (wchar2);
+ if ((wchar2 >= 'A') && (wchar2 <= 'Z'))
+ wchar2 += ('a' - 'A');
return (wchar1 < wchar2) ? -1 : ((wchar1 == wchar2) ? 0 : 1);
}