aboutsummaryrefslogtreecommitdiffstats
path: root/awklib/eg/prog/wc.awk
diff options
context:
space:
mode:
Diffstat (limited to 'awklib/eg/prog/wc.awk')
-rw-r--r--awklib/eg/prog/wc.awk4
1 files changed, 2 insertions, 2 deletions
diff --git a/awklib/eg/prog/wc.awk b/awklib/eg/prog/wc.awk
index 8fb48164..d51b9ff2 100644
--- a/awklib/eg/prog/wc.awk
+++ b/awklib/eg/prog/wc.awk
@@ -34,14 +34,14 @@ BEGIN {
}
function beginfile(file)
{
- chars = lines = words = 0
+ lines = words = chars = 0
fname = FILENAME
}
function endfile(file)
{
- tchars += chars
tlines += lines
twords += words
+ tchars += chars
if (do_lines)
printf "\t%d", lines
if (do_words)