From 931e0f2a708965001857d60cedf1b1940389cbe6 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 5 Jan 2012 09:26:32 +0100 Subject: 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 --- tests/split/l-chunk | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests/split') diff --git a/tests/split/l-chunk b/tests/split/l-chunk index dd92b7002..c4e696815 100755 --- a/tests/split/l-chunk +++ b/tests/split/l-chunk @@ -40,6 +40,9 @@ split -n l/2 /dev/zero test "$(stat -c %s x* | wc -l)" = '2' || fail=1 rm x?? +# Repeat the above, but with 1/2, not l/2: +split -n 1/2 /dev/zero || fail=1 + # Ensure --elide-empty-files is honored split -e -n l/10 /dev/null || fail=1 stat x?? 2>/dev/null && fail=1 -- cgit v1.2.3-70-g09d2