aboutsummaryrefslogtreecommitdiff
path: root/sys/libn
diff options
context:
space:
mode:
authorNicholas Noll <nbnoll@eml.cc>2021-10-05 16:57:55 -0700
committerNicholas Noll <nbnoll@eml.cc>2021-10-05 16:57:55 -0700
commit08d3749a636f9cd51f70ba1eed043be8e6c2eca9 (patch)
treec17cdff0796b73758a96977614d84f04d22c3bfb /sys/libn
parent2e80e18c190b737338f8000aafe685719b4899a1 (diff)
feat(term): added ligature support. some combining character help
Diffstat (limited to 'sys/libn')
-rw-r--r--sys/libn/string.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/libn/string.c b/sys/libn/string.c
index bf5d645..22a3359 100644
--- a/sys/libn/string.c
+++ b/sys/libn/string.c
@@ -40,26 +40,26 @@ utf8·bytetorune(rune* r, byte* s)
rune l;
c[0] = *(ubyte*)(s);
- if (c[0] < Tx) {
+ if(c[0] < Tx) {
*r = c[0];
return 1;
}
l = c[0];
- for (i = 1; i < UTFmax; i++) {
+ for(i = 1; i < UTFmax; i++) {
c[i] = *(ubyte*)(s+i);
c[i] ^= Tx;
if (c[i] & Testx) goto bad;
l = (l << Bitx) | c[i];
- if (c[0] < Tbyte(i + 2)) {
+ if(c[0] < Tbyte(i + 2)) {
l &= RuneX(i + 1);
if (i == 1) {
- if (c[0] < Tbyte(2) || l <= Rune1)
+ if (c[0] < Tbyte(2) || l <= Rune1)
goto bad;
- } else if (l <= RuneX(i) || l > RuneMax)
+ } else if (l <= RuneX(i) || l > RuneMax)
goto bad;
- if (i == 2 && SurrogateMin <= l && l <= SurrogateMax)
+ if (i == 2 && SurrogateMin <= l && l <= SurrogateMax)
goto bad;
*r = l;