diff options
author | Pádraig Brady <P@draigBrady.com> | 2010-10-07 13:12:36 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2010-10-07 20:08:16 +0100 |
commit | 758916b49e69836fcbd1e861e19edfced44e28ea (patch) | |
tree | f1f3f1b4117e9efb4ea1f27bb1e9a0b5e4453579 /tests | |
parent | 6483f0e1bd4ae5b5b300512c96cc3028d643a58c (diff) | |
download | coreutils-758916b49e69836fcbd1e861e19edfced44e28ea.tar.xz |
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.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/misc/split-fail | 6 |
1 files changed, 6 insertions, 0 deletions
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 |