From a38becce9752e67f71e79e8c230b327869802e70 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 29 Sep 2006 16:52:48 +0000 Subject: * src/shuf.c (read_input): Fix an off-by-one error that would cause an infloop for piped input of 8KB or more. * NEWS: Mention the fix. * tests/misc/shuf: Test for the above fix. --- tests/misc/shuf | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/misc/shuf') diff --git a/tests/misc/shuf b/tests/misc/shuf index 585df9901..17a74dd3f 100755 --- a/tests/misc/shuf +++ b/tests/misc/shuf @@ -51,4 +51,8 @@ cmp in out > /dev/null && { fail=1; echo "not random?" 1>&2; } sort -n out > out1 cmp in out1 || { fail=1; echo "not a permutation" 1>&2; } +# Before coreutils-6.3, this would infloop. +# "seq 1860" produces 8193 bytes of output. +seq 1860 | shuf > /dev/null || fail=1 + (exit $fail); exit $fail -- cgit v1.2.3-54-g00ecf