commit b744ad5216e4ab66151d97086162c8cf8aff8380
Author: sin <s...@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
@@ -95,6 +95,8 @@ wc(FILE *fp, const char *str)
                        nw++;
                }
        }
+       if (word)
+               nw++;
        tc += nc;
        tl += nl;
        tw += nw;


Reply via email to