would cause an infloop for piped input of 8KB or more.
* NEWS: Mention the fix.
* tests/misc/shuf: Test for the above fix.
2006-09-29 Jim Meyering <jim@meyering.net>
+ * 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.
+
Since any system may be affected by the Darwin readdir bug,
perform the extra rewinddir unconditionally. The performance
impact of rewinding a directory is negligible.
"groups" now processes options like --help more compatibly.
+ shuf would infloop, given 8KB or more of piped input
+
+
* Major changes in release 6.2 (2006-09-18) [stable candidate]
** Changes in behavior
do
{
- if (alloc == used)
+ if (alloc <= used + 1)
{
if (alloc == SIZE_MAX)
xalloc_die ();
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