From 0cadb4301d18724e7513d7489cb5bebd262c82f1 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Fri, 11 Sep 2009 17:03:06 -0400 Subject: convert to 4-byte UTF-8 and 32-bit Rune http://codereview.appspot.com/116075 --- src/cmd/sam/cmd.c | 2 +- src/cmd/sam/regexp.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/cmd/sam') diff --git a/src/cmd/sam/cmd.c b/src/cmd/sam/cmd.c index cdf00b9b..12510689 100644 --- a/src/cmd/sam/cmd.c +++ b/src/cmd/sam/cmd.c @@ -71,7 +71,7 @@ int inputc(void) { int n, nbuf; - char buf[3]; + char buf[UTFmax]; Rune r; Again: diff --git a/src/cmd/sam/regexp.c b/src/cmd/sam/regexp.c index 3477baef..3234d731 100644 --- a/src/cmd/sam/regexp.c +++ b/src/cmd/sam/regexp.c @@ -494,7 +494,7 @@ bldcclass(void) exprp++; /* eat '-' */ if((c2 = nextrec()) == ']') goto Error; - classp[n+0] = 0xFFFF; + classp[n+0] = Runemax; classp[n+1] = c1; classp[n+2] = c2; n += 3; @@ -516,7 +516,7 @@ classmatch(int classno, int c, int negate) p = class[classno]; while(*p){ - if(*p == 0xFFFF){ + if(*p == Runemax){ if(p[1]<=c && c<=p[2]) return !negate; p += 3; -- cgit v1.2.3