]> git.ipfire.org Git - thirdparty/coreutils.git/commit
wc: don’t assume opening a file puts you at start
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 14 Jul 2025 20:32:27 +0000 (13:32 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 4 Aug 2025 02:48:04 +0000 (19:48 -0700)
commitdfe4df56948294c4889b7201f7b6636b8ff01ea5
treec3ef034b008d2698053c9d60a84740adfcdd63bf
parentc9e2dd531dc8bad5af7dfec3f7ecd961f40c5866
wc: don’t assume opening a file puts you at start

This is not true on Solaris when opening /dev/stdin; it could be
at a nonzero file offset.  Arguably Linux should do likewise.
* src/wc.c (wc): Omit last arg, and act as if it is always -1.
All uses changed.
src/wc.c