From 758916b49e69836fcbd1e861e19edfced44e28ea Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Thu, 7 Oct 2010 13:12:36 +0100 Subject: split: fix reporting of read errors The bug was introduced with commit 23f6d41f, 19-02-2003. * src/split.c (bytes_split, lines_split, line_bytes_split): Correctly check the return from full_read(). * tests/misc/split-fail: Ensure split fails when it can't read its input. * NEWS: Mention the fix. --- tests/misc/split-fail | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/misc/split-fail') diff --git a/tests/misc/split-fail b/tests/misc/split-fail index e36c86dc9..68c9d7334 100755 --- a/tests/misc/split-fail +++ b/tests/misc/split-fail @@ -64,5 +64,11 @@ split: line count option -99*... is too large EOF compare out exp || fail=1 +# Make sure split fails when it can't read input +# (the current directory in this case) +if ! cat . >/dev/null; then + # can't read() directories + split . && fail=1 +fi Exit $fail -- cgit v1.2.3-54-g00ecf