diff options
author | William R. Fraser <wfraser@codewise.org> | 2016-03-20 17:44:09 -0700 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2016-12-19 20:13:51 +0000 |
commit | 9944e4763bb178852727812e8b188540772384e2 (patch) | |
tree | 02803ee9f30391c6c9c1520fd61fe7f57099af95 /src/wc.c | |
parent | f071b04afaeefbf6c37a00986fec02b8df5e9560 (diff) | |
download | coreutils-9944e4763bb178852727812e8b188540772384e2.tar.xz |
wc: fix wrong byte counts when using --files-from0
* src/wc.c (main): Reset fstatus[0].failed between files when reusing
the fstatus[0] entry in --files-from0 mode. This ensures a stat() is
done for each file, avoiding incorrect counts and redundant reading.
* NEWS: Mention the bug fix.
* tests/misc/wc-files0.sh: Add a test case.
Fixes http://bugs.gnu.org/23073
Diffstat (limited to 'src/wc.c')
-rw-r--r-- | src/wc.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -807,6 +807,9 @@ main (int argc, char **argv) ok = false; else ok &= wc_file (file_name, &fstatus[nfiles ? i : 0]); + + if (! nfiles) + fstatus[0].failed = 1; } argv_iter_done: |