split: fix a case where --elide-empty causes invalid chunking
authorPádraig Brady <P@draigBrady.com>
Wed, 8 Dec 2010 08:33:15 +0000 (08:33 +0000)
committerPádraig Brady <P@draigBrady.com>
Wed, 8 Dec 2010 23:36:17 +0000 (23:36 +0000)
commit195c455d0ae3884ab2d9680ac3043aa36e9c8c3d
tree5b201f869b06aeb2c3e8820292090b6a2c7e4d14
parenta1629ba1ecc227a26be6adae596d17defc3ca324
split: fix a case where --elide-empty causes invalid chunking

When -n l/N is used and long lines are present that both
span partitions and multiple buffers, one would get
inconsistent chunk sizes.

* src/split.c (main): Add a new undocumented ---io-blksize option
to support full testing with varied buffer sizes.
(cwrite): Refactor most handling of --elide-empty to here.
(bytes_split): Remove handling of --elide-empty.
(lines_chunk_split): Likewise.  The specific issue here
was the first handling of elide_empty_files interfered
with the replenishing of the input buffer.
* test/misc/split-lchunk: Add -e and the new ---io-blksize
combinations to the test.
src/split.c
tests/misc/split-lchunk