aboutsummaryrefslogtreecommitdiff
path: root/src/base/utf/canfit.c
diff options
context:
space:
mode:
authorNicholas <nbnoll@eml.cc>2021-11-20 20:12:21 -0800
committerNicholas <nbnoll@eml.cc>2021-11-20 20:12:21 -0800
commit138fb272fae79587de3469493b55e4d18eadc722 (patch)
tree447d2af80b8c2ea080253e76d33e128c9b27d3f6 /src/base/utf/canfit.c
parentc9a32c1a43d2bdded07eaa45732c3a6e195a5442 (diff)
Feat: added buffered io from plan9
As we no longer have the FILE type, we need to buffer our reading and writing so that we don't have to make so many syscalls. The API is nice so that we can buffer other readers. We will update it so that it eats io·Readers/io·Writers.
Diffstat (limited to 'src/base/utf/canfit.c')
-rw-r--r--src/base/utf/canfit.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/base/utf/canfit.c b/src/base/utf/canfit.c
index 4579ab3..fddf580 100644
--- a/src/base/utf/canfit.c
+++ b/src/base/utf/canfit.c
@@ -2,7 +2,7 @@
/* returns 1 if string of length n is long enough to be decoded */
int
-utf8·canfit(byte* s, int n)
+utf8·fullrune(byte* s, int n)
{
int i;
rune c;
@@ -13,7 +13,6 @@ utf8·canfit(byte* s, int n)
c = *(ubyte*)s;
if(c < TByte1)
return 1;
-
if(c < TByte3)
return n >= 2;
if(c < TByte4)