summaryrefslogtreecommitdiffhomepage
path: root/src/utf8code.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-05-31 21:19:06 +0200
committerTyge Løvset <[email protected]>2022-05-31 21:19:06 +0200
commit22c20b522fcc9cc0743ad04fe6c3203c7a778401 (patch)
tree513f16f89df39eedac68751b65518f400b71db7d /src/utf8code.c
parent063127c6749871a05fe20b510676387ee88a4789 (diff)
downloadSTC-modified-22c20b522fcc9cc0743ad04fe6c3203c7a778401.tar.gz
STC-modified-22c20b522fcc9cc0743ad04fe6c3203c7a778401.zip
Added simple utf8 case insensitive wrappers: cstr_iequals(), cstr_istarts_with(), and cstr_iends_with().
Diffstat (limited to 'src/utf8code.c')
-rw-r--r--src/utf8code.c4
1 files changed, 2 insertions, 2 deletions
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;