This commit is contained in:
Connor Lane Smith
2011-06-08 21:30:33 +01:00
parent 2404eb5b6b
commit ff97891dad
7 changed files with 131 additions and 4 deletions

2
wc.c
View File

@@ -75,7 +75,7 @@ wc(FILE *fp, const char *str)
long nc = 0, nl = 0, nw = 0;
while((c = fgetc(fp)) != EOF) {
if(cmode != 'm' || (c & 0xc0) != 0x80) /* utf8 */
if(cmode != 'm' || UTF8_POINT(c))
nc++;
if(c == '\n')
nl++;