commit d412dad4709299674f5d0b137ccbb95a031815f2
Author: sin <[email protected]>
Date:   Mon Apr 20 11:26:05 2015 +0100

    Simplify condition in wc(1)

diff --git a/wc.c b/wc.c
index e57cb4c..4995116 100644
--- a/wc.c
+++ b/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))

Reply via email to