cut: with -f, process each line independently
authorPádraig Brady <P@draigBrady.com>
Mon, 21 Jan 2013 15:37:37 +0000 (15:37 +0000)
committerPádraig Brady <P@draigBrady.com>
Sat, 26 Jan 2013 02:31:53 +0000 (02:31 +0000)
commit51ce0bf8440e18de34586003b1a5d7f568fbf636
tree03bb7348eb727280dbc428072434d32dfcc96908
parenta46d8d02f2b0e49d851a45e63420744b10a10ed4
cut: with -f, process each line independently

Previously line N+1 was inspected before line N was fully output,
which causes output ordering issues at the terminal or delays
from intermittent sources like tail -f.

* src/cut.c (cut_fields): Adjust so that we record the
previous output character so we can use that info to
determine wether to output a '\n' or not.
* tests/misc/cut.pl: Add tests to ensure existing
functionality isn't broken.
* NEWS: Mention the fix.
Fixes bug http://bugs.gnu.org/13498
NEWS
src/cut.c
tests/misc/cut.pl