* NEWS: Mention the improvement.
* src/fmt.c (put_line): Exit if any error writing line.
(flush_paragraph): Exit if any error writing buffer.
* tests/misc/write-errors.sh: Enable the (flush_paragraph) test case,
and add another to check the put_line() case.
** Improvements
+ 'fmt' 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.
'numfmt':
if (word_limit == word)
{
- fwrite (parabuf, sizeof *parabuf, wptr - parabuf, stdout);
+ size_t to_write = wptr - parabuf;
+ if (fwrite (parabuf, 1, to_write, stdout) != to_write)
+ write_error ();
+
wptr = parabuf;
return;
}
put_word (w);
last_line_length = out_column;
putchar ('\n');
+
+ if (ferror (stdout))
+ write_error ();
}
/* Output to stdout the word W. */
dd if=/dev/zero
expand /dev/zero
factor --version; yes 1 | factor
-# TODO: fmt /dev/zero
+fmt /dev/zero
+fmt --version; yes | fmt
fold /dev/zero
fold -b /dev/zero
fold -c /dev/zero