cut: do not print extraneous delimiters in some unusual cases
authorJim Meyering <jim@meyering.net>
Sat, 24 Nov 2012 19:36:15 +0000 (11:36 -0800)
committerJim Meyering <jim@meyering.net>
Sat, 24 Nov 2012 23:23:31 +0000 (15:23 -0800)
commit06aeeecb3fe2655fd5e4e12948b389873a79884b
treef779e7817903f75566e21451dcbb279fc9161f2f
parent1b874511b60252a5c71c7a29046afdc99e5391bb
cut: do not print extraneous delimiters in some unusual cases

When printing output delimiters, and when a to-EOL range subsumes
at least one other range, cut would mistakenly print delimiters for
the subsumed range.  This bug was probably introduced via commit
v5.2.1-639-g847e066.
* src/cut.c (set_fields): Ignore any range that is subsumed by a
to-EOL range.  Also, move two declarations down.
* tests/misc/cut.pl: Add tests to exercise this.
* NEWS (Bug fixes): Mention it.
Reported by Marcel Böhme in http://bugs.gnu.org/12966
NEWS
src/cut.c
tests/misc/cut.pl