diff options
author | rsc <devnull@localhost> | 2006-02-17 18:21:29 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2006-02-17 18:21:29 +0000 |
commit | 05f5d46b6368978fd22cfbea7155e983b0faa9a7 (patch) | |
tree | a56b09bd3124413746010a9ef5e803ea5b186d08 /src/cmd/mpm/slug.cc | |
parent | eacea5a0647ba94a9d5906b2b4b7b5761bcef6e9 (diff) | |
download | plan9port-05f5d46b6368978fd22cfbea7155e983b0faa9a7.tar.gz plan9port-05f5d46b6368978fd22cfbea7155e983b0faa9a7.tar.bz2 plan9port-05f5d46b6368978fd22cfbea7155e983b0faa9a7.zip |
make compile
Diffstat (limited to 'src/cmd/mpm/slug.cc')
-rw-r--r-- | src/cmd/mpm/slug.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/cmd/mpm/slug.cc b/src/cmd/mpm/slug.cc index b4ae0ff8..92d48db3 100644 --- a/src/cmd/mpm/slug.cc +++ b/src/cmd/mpm/slug.cc @@ -1,7 +1,6 @@ #include "misc.h" #include "slug.h" #include <math.h> -#include <utf.h> static char *bufptr(int); @@ -149,6 +148,19 @@ static void adds(char *s) addc(*p); } +static int fullrune(char *c, int n) +{ + if(n <= 0) + return 0; + if(n>=1 && (unsigned char)c[0] < 0x80) + return 1; + if(n>=2 && (unsigned char)c[0] < 0xE0) + return 1; + if(n>=3) + return 1; + return 0; +} + static char *getutf(FILE *fp) // get 1 utf-encoded char (might be multiple bytes) { static char buf[100]; |