wc

Count words in <50 lines of C
Log | Files | Refs | README

commit 6b0e66b738c92362dffffa2c3318f72a2d357261
parent d5026e5b7690ee5c22ded91d569b59f09955223e
Author: NunoSempere <nuno.sempere@protonmail.com>
Date:   Fri, 15 Sep 2023 12:43:43 +0300

fix small inaccuracy in README

Diffstat:
MREADME.md | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md @@ -13,7 +13,7 @@ The Unix utility wc counts words. You can make simple, non-POSIX compatible vers ## Comparison with other versions of wc -The [version of wc.c](https://git.nunosempere.com/personal/wc/src/branch/master/src/wc.c) in this repository sits at 44 lines. It decides to read from stdin if the number of arguments fed to it is otherwise zero, and uses the linux `read` function to read character by character. It doesn't have flags, instead, there are further utilities in the src/extra/ folder for counting characters and lines, sitting at 32 and 35 lines of code, respectively. This version also has little error checking. +The [version of wc.c](https://git.nunosempere.com/personal/wc/src/branch/master/src/wc.c) in this repository sits at 44 lines. It decides to read from stdin if the number of arguments fed to it is otherwise zero, and uses the standard c function `getc` to read character by character. It doesn't have flags, instead, there are further utilities in the src/extra/ folder for counting characters and lines, sitting at 32 and 35 lines of code, respectively. This version also has little error checking. [Here](https://github.com/dspinellis/unix-history-repo/blob/Research-V7-Snapshot-Development/usr/src/cmd/wc.c) is a version of wc from UNIX V7, at 86 lines. It allows for counting characters, words and lines. I couldn't find a version in UNIX V6, so I'm guessing this is one of the earliest versions of this program. It decides to read from stdin if the number of arguments fed to it is zero, and reads character by character using the standard C `getc` function.