From 22c20b522fcc9cc0743ad04fe6c3203c7a778401 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Tue, 31 May 2022 21:19:06 +0200 Subject: Added simple utf8 case insensitive wrappers: cstr_iequals(), cstr_istarts_with(), and cstr_iends_with(). --- src/utf8code.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/utf8code.c') diff --git a/src/utf8code.c b/src/utf8code.c index 0f74ffb6..cda730ce 100644 --- a/src/utf8code.c +++ b/src/utf8code.c @@ -87,8 +87,8 @@ uint32_t utf8_toupper(uint32_t c) { int utf8_icmp(const char* s1, const char* s2) { utf8_decode_t d1 = {.state=0}, d2 = {.state=0}; for (;;) { - do { utf8_decode(&d1, (uint8_t)s1[j1++]); } while (d1.state); - do { utf8_decode(&d2, (uint8_t)s2[j2++]); } while (d2.state); + do { utf8_decode(&d1, (uint8_t)*s1++); } while (d1.state); + do { utf8_decode(&d2, (uint8_t)*s2++); } while (d2.state); int c = utf8_tolower(d1.codep) - utf8_tolower(d2.codep); if (c || !*s2) return c; -- cgit v1.2.3