split: avoid failure due to leftover 'errno' value
* src/split.c (lines_chunk_split): Fix logic bug that led to
unwarranted failure of "split -n l/2 /dev/zero" on NetBSD 5.1.
The same would happen when splitting a growing file, where
open/lseek-end gives one size, but by the time we read, there
is more data available.
(bytes_chunk_extract): Likewise.
* NEWS (Bug fixes): Mention this.
* tests/split/l-chunk: The latter case was not exercised.
Add code to do that.
Bug introduced with the chunk-selecting feature in v8.7-25-gbe10739.
Co-authored-by: Jim Meyering <meyering@redhat.com>