Simplify condition in wc(1)
This commit is contained in:
parent
cd0b771cbb
commit
d412dad470
3
wc.c
3
wc.c
|
@ -32,8 +32,7 @@ wc(FILE *fp, const char *str)
|
|||
size_t nc = 0, nl = 0, nw = 0;
|
||||
|
||||
while ((rlen = efgetrune(&c, fp, str))) {
|
||||
nc += (cmode == 'c' || !cmode) ? rlen :
|
||||
(c != Runeerror) ? 1 : 0;
|
||||
nc += (cmode == 'c' || !cmode) ? rlen : (c != Runeerror);
|
||||
if (c == '\n')
|
||||
nl++;
|
||||
if (!isspacerune(c))
|
||||
|
|
Loading…
Reference in New Issue
Block a user