From 08d3749a636f9cd51f70ba1eed043be8e6c2eca9 Mon Sep 17 00:00:00 2001 From: Nicholas Noll Date: Tue, 5 Oct 2021 16:57:55 -0700 Subject: feat(term): added ligature support. some combining character help --- sys/libn/string.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sys/libn') 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; -- cgit v1.2.1