* src/pr.c (print_page): Exit promptly for `yes | pr`.
(print_clump): Exit promptly for `pr < /dev/zero`.
* tests/misc/write-errors.sh: Enable test cases.
* NEWS: Mention the improvement.
** Improvements
- 'fmt' and 'nl' will now exit promptly upon receiving a write error,
+ 'fmt', 'nl', and 'pr' will now exit promptly upon receiving a write error,
which is significant when reading large / unbounded inputs.
'install' now uses posix_spawn() to invoke the strip program more efficiently.
print_a_FF = false;
}
+ if (ferror (stdout))
+ write_error ();
+
if (last_page_number < ++page_number)
return false; /* Stop printing with LAST_PAGE */
{
while (n--)
(p->char_func) (*clump++);
+
+ if (ferror (stdout))
+ write_error ();
}
/* Print a character.
numfmt --version; yes 1 | numfmt
od -v /dev/zero
paste /dev/zero
-# TODO: pr /dev/zero
+pr /dev/zero
+pr --version; yes 1 | pr
seq inf
tail -n+1 -z /dev/zero
tee < /dev/zero