summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-05-07 18:27:02 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-05-07 18:27:02 +0200
commit5271bfb1eec2d6c283bc3f0d3a85cad471c26b3a (patch)
treeb198c9c2eb07855c62d1d1eb47003e94db0add98
parent772e0d0870d912b9b765caf3991bf421d538b0e9 (diff)
downloadxK-5271bfb1eec2d6c283bc3f0d3a85cad471c26b3a.tar.gz
xK-5271bfb1eec2d6c283bc3f0d3a85cad471c26b3a.tar.xz
xK-5271bfb1eec2d6c283bc3f0d3a85cad471c26b3a.zip
degesch: fix utf8_common-prefix()
-rw-r--r--degesch.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/degesch.c b/degesch.c
index ea93fdf..3b1bc9a 100644
--- a/degesch.c
+++ b/degesch.c
@@ -5134,9 +5134,11 @@ utf8_common_prefix (const char **vector, size_t len)
{
for (size_t i = 1; i < len; i++)
{
- // Not bothering with lowercasing non-ASCII
int32_t other = utf8_iter_next (&a[i], NULL);
- if (other < 0 || ch >= 0x80 || other >= 0x80
+ if (ch == other)
+ continue;
+ // Not bothering with lowercasing non-ASCII
+ if (ch >= 0x80 || other >= 0x80
|| tolower_ascii (ch) != tolower_ascii (other))
return prefix;
}