[hackers] [sbase] If there's no newline we don't count the last word - fix it || sin

From: <git_AT_suckless.org>
Date: Fri, 10 Jan 2014 23:52:08 +0100

commit b744ad5216e4ab66151d97086162c8cf8aff8380
Author: sin <sin_AT_2f30.org>
Date: Fri Jan 10 22:51:13 2014 +0000

    If there's no newline we don't count the last word - fix it

diff --git a/wc.c b/wc.c
index ba76a68..cd0bf46 100644
--- a/wc.c
+++ b/wc.c
_AT_@ -95,6 +95,8 @@ wc(FILE *fp, const char *str)
                         nw++;
                 }
         }
+ if (word)
+ nw++;
         tc += nc;
         tl += nl;
         tw += nw;
Received on Fri Jan 10 2014 - 23:52:08 CET

This archive was generated by hypermail 2.3.0 : Sat Jan 11 2014 - 00:00:25 CET