cut: fix -f to work with the -d$'\n' edge case
commitd302aed182d625281fba87aca3cb513882aa967b
authorPádraig Brady <P@draigBrady.com>
Tue, 22 Jan 2013 01:34:07 +0000 (22 01:34 +0000)
committerPádraig Brady <P@draigBrady.com>
Sat, 26 Jan 2013 02:31:59 +0000 (26 02:31 +0000)
treeba7fffb25d51deb1632cebc17456152cd047d329
parent51ce0bf8440e18de34586003b1a5d7f568fbf636
cut: fix -f to work with the -d$'\n' edge case

* src/cut.c (cut_fields): Handle the edge case where '\n' is
the delimiter, which could be used for example to suppress
the last line if it doesn't contain a '\n'.
* test/misc/cut.pl: Add tests for this edge case.
src/cut.c
tests/misc/cut.pl