summaryrefslogtreecommitdiffhomepage
path: root/src/utf8code.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-08-09 02:09:51 +0200
committerTyge Løvset <[email protected]>2022-08-09 02:09:51 +0200
commit0861b814130ab77b0e228e6f41a8c898959d69f1 (patch)
tree5dc7842ad35515a09eda3c4f64d7caf777e1cc84 /src/utf8code.c
parent919bd0757fd11c67371e92d8d272b59731316251 (diff)
downloadSTC-modified-0861b814130ab77b0e228e6f41a8c898959d69f1.tar.gz
STC-modified-0861b814130ab77b0e228e6f41a8c898959d69f1.zip
Two more fixes on csview comparison.
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 1790ad62..ebd434ea 100644
--- a/src/utf8code.c
+++ b/src/utf8code.c
@@ -110,10 +110,10 @@ int utf8_icmp_sv(const csview s1, const csview s2) {
do { utf8_decode(&d1, (uint8_t)s1.str[j1++]); } while (d1.state);
do { utf8_decode(&d2, (uint8_t)s2.str[j2++]); } while (d2.state);
int32_t c = utf8_casefold(d1.codep) - utf8_casefold(d2.codep);
- if (c || !s2.str[j2 - 1]) // OK if s1.size / s2.size are npos
+ if (c || !s2.str[j2 - 1]) // OK if s1.size and s2.size are npos
return c;
}
- return 0;
+ return s1.size - s2.size;
}
bool utf8_isupper(uint32_t c) {