+ while ((optc = getopt_long (argc, argv, "clLmwz", longopts, NULL)) != -1)
switch (optc)
{
case 'c':
===
Also,
If I understand what the patch does, it only changes the delimiter of the
output line,
but still treats NL as the input delimiters ?
e.g. the following gives 2 instead of 1:
$ printf "a\nb\nc\x00" | ./src/wc -z -l
2
I can understand if the goal is to be strict POSIX-like (and always count NLs,
not logical lines),
but this can lead to counter-intuitive results when combined with other
programs.
Since this returns 10:
$ cat FOO | head -n10 | wc -l
I would naively expect this to return 10 as well:
$ cat null-terminated-FOO | head -z -n10 | wc -z -l
And similarly:
$ cat FOO | tr '\n' '\0' | head -z -n10 | wc -z -l
but currently it will return 0 (or as many embedded NLs that are in the input,
but not 10).
What do you think?
regards,
- assaf