]> git.ipfire.org Git - thirdparty/coreutils.git/commit
wc: fix regression determining file size
authorPádraig Brady <P@draigBrady.com>
Wed, 28 Dec 2022 14:04:19 +0000 (14:04 +0000)
committerPádraig Brady <P@draigBrady.com>
Thu, 29 Dec 2022 14:15:54 +0000 (14:15 +0000)
commit266b7cbc846f91e5f48085c7de68682f5841e2a0
treed5c1f183ed8622126e4d739bdf0901733913b74b
parent4bf990bf658d4070e74fc64b0fafef4d305af8f4
wc: fix regression determining file size

* src/wc.c (wc): Use off_t rather than size_t
when calculating where to seek to, so that
we don't seek to a too low offset on systems
where size_t < off_t, which would result in
many read() calls to determine the file size.
* tests/misc/wc-proc.sh: Add a test case
sufficient for 32 bit systems at least.
* NEWS: Mention the bug fix.
Reported at https://bugs.debian.org/1027101
NEWS
src/wc.c
tests/misc/wc-proc.sh