Simplify condition in wc(1)

This commit is contained in:
sin 2015-04-20 11:26:05 +01:00
parent cd0b771cbb
commit d412dad470

3
wc.c
View File

@ -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))