From 1b874511b60252a5c71c7a29046afdc99e5391bb Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 23 Nov 2012 23:09:10 -0800 Subject: cut: treat -b2-,3- like -b2-, not like -b3- MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * src/cut.c (set_fields): When two right-open-ended ranges are specified, don't blindly let the latter one take precedence over the former. Instead, use the union of the ranges. * 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 Thanks to Berhard Voelker for catching log and NEWS typos. --- tests/misc/cut.pl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'tests') diff --git a/tests/misc/cut.pl b/tests/misc/cut.pl index cd5655569..cb4781a7d 100755 --- a/tests/misc/cut.pl +++ b/tests/misc/cut.pl @@ -163,6 +163,9 @@ my @Tests = ['big-unbounded-b', '--output-d=:', '-b1234567890-', {IN=>''}, {OUT=>''}], ['big-unbounded-c', '--output-d=:', '-c1234567890-', {IN=>''}, {OUT=>''}], ['big-unbounded-f', '--output-d=:', '-f1234567890-', {IN=>''}, {OUT=>''}], + + ['overlapping-unbounded-1', '-b3-,2-', {IN=>"1234\n"}, {OUT=>"234\n"}], + ['overlapping-unbounded-2', '-b2-,3-', {IN=>"1234\n"}, {OUT=>"234\n"}], ); if ($mb_locale ne 'C') -- cgit v1.2.3-54-g00ecf