summaryrefslogtreecommitdiffhomepage
path: root/src/utf8code.c
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2022-09-22 07:28:20 +0200
committerTyge Løvset <[email protected]>2022-09-22 07:28:20 +0200
commit43b5d0ec65ecf06bc28c4ba90bd75aaa16d4169b (patch)
tree00497ba77f0c47a0943cb52861fa2179e5c4052b /src/utf8code.c
parentc3cefd740a90378a53698df639d7889c6baffcb8 (diff)
downloadSTC-modified-43b5d0ec65ecf06bc28c4ba90bd75aaa16d4169b.tar.gz
STC-modified-43b5d0ec65ecf06bc28c4ba90bd75aaa16d4169b.zip
Renamed c_forfiltered() back to c_forfilter(), and iter member .count => .taken
Diffstat (limited to 'src/utf8code.c')
-rw-r--r--src/utf8code.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/utf8code.c b/src/utf8code.c
index 45f1613d..25244f07 100644
--- a/src/utf8code.c
+++ b/src/utf8code.c
@@ -48,10 +48,9 @@ unsigned utf8_encode(char *out, uint32_t c)
uint32_t utf8_peek(const char* s, int pos) {
int inc = -1;
- if (pos > 0)
- pos = -pos, inc = 1;
- while (pos)
- pos += (*(s += inc) & 0xC0) != 0x80;
+ if (pos > 0) pos = -pos, inc = 1;
+ while (pos) pos += (*(s += inc) & 0xC0) != 0x80;
+
utf8_decode_t d = {.state=0};
do { utf8_decode(&d, (uint8_t)*s++); } while (d.state);
return d.codep;