mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-04-20 10:51:48 +02:00
nl: promptly diagnose write errors
* NEWS: Mention the improvement. * src/nl.c (process_file): Exit if error outputting line. * tests/misc/write-errors.sh: Enable the test case.
This commit is contained in:
2
NEWS
2
NEWS
@@ -43,7 +43,7 @@ GNU coreutils NEWS -*- outline -*-
|
||||
|
||||
** Improvements
|
||||
|
||||
'fmt' will now exit promptly upon receiving a write error,
|
||||
'fmt' and 'nl' 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.
|
||||
|
||||
3
src/nl.c
3
src/nl.c
@@ -425,6 +425,9 @@ process_file (FILE *fp)
|
||||
proc_text ();
|
||||
break;
|
||||
}
|
||||
|
||||
if (ferror (stdout))
|
||||
write_error ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ fold -c /dev/zero
|
||||
fold --version; yes | tr -d '\\n' | fold
|
||||
head -z -n-1 /dev/zero
|
||||
join -a 1 -z /dev/zero /dev/null
|
||||
# TODO: nl --version; yes | nl
|
||||
nl --version; yes | nl
|
||||
numfmt --version; yes 1 | numfmt
|
||||
od -v /dev/zero
|
||||
paste /dev/zero
|
||||
|
||||
Reference in New Issue
Block a user