From unknown Thu Jun 19 16:24:33 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#12966 <12966@debbugs.gnu.org> To: bug#12966 <12966@debbugs.gnu.org> Subject: Status: cut: Problems with overlapping, open-ended ranges Reply-To: bug#12966 <12966@debbugs.gnu.org> Date: Thu, 19 Jun 2025 23:24:33 +0000 retitle 12966 cut: Problems with overlapping, open-ended ranges reassign 12966 coreutils submitter 12966 "Marcel B=C3=B6hme" severity 12966 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 23 03:13:37 2012 Received: (at submit) by debbugs.gnu.org; 23 Nov 2012 08:13:38 +0000 Received: from localhost ([127.0.0.1]:33991 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TboOE-0004uz-59 for submit@debbugs.gnu.org; Fri, 23 Nov 2012 03:13:37 -0500 Received: from eggs.gnu.org ([208.118.235.92]:51887) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TboO8-0004up-So for submit@debbugs.gnu.org; Fri, 23 Nov 2012 03:13:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TboMh-0000my-Uh for submit@debbugs.gnu.org; Fri, 23 Nov 2012 03:12:03 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HTML_MESSAGE, MIME_HTML_ONLY, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:57128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TboMh-0000mu-Rm for submit@debbugs.gnu.org; Fri, 23 Nov 2012 03:11:59 -0500 Received: from eggs.gnu.org ([208.118.235.92]:59503) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TboMc-0002z8-4I for bug-coreutils@gnu.org; Fri, 23 Nov 2012 03:11:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TboMW-0000m3-Fw for bug-coreutils@gnu.org; Fri, 23 Nov 2012 03:11:54 -0500 Received: from mout.web.de ([212.227.15.4]:60792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TboMW-0000lv-6S for bug-coreutils@gnu.org; Fri, 23 Nov 2012 03:11:48 -0500 Received: from 3capp-webde-bs50.server.lan ([172.19.170.106]) by mriweb.server.lan (mriweb002) with ESMTPA (Nemesis) id 0Lxaxp-1TCxrd42TD-0170o6 for ; Fri, 23 Nov 2012 09:11:46 +0100 Received: from [137.132.225.108] by 3capp-webde-bs50.server.lan with HTTP; Fri Nov 23 09:11:46 CET 2012 MIME-Version: 1.0 Message-ID: From: =?UTF-8?Q?=22Marcel_B=C3=B6hme=22?= To: bug-coreutils@gnu.org Subject: cut: Problems with overlapping, open-ended ranges Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 23 Nov 2012 09:11:46 +0100 (CET) Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K0:52uJU0gUUs4gmQTgj3fgtInVu+MzR8Q5pZL6OmcbIo4 VDJ0DMJHp1wwlbAJ845J+dY/AS/n5MOF8U3McbW1V8Qqq/0E/H BPhvRCN4zlzS72DJxxp0c6iChG7nKIKDyDheP4DM6AG9oUHxOs BUbFp+7FQJ1FVAPyPqjoohCni5/l4TEDzrqJLU8WbtSAVP9VfB 6rcFUCSmqOnfB+KDFysvv0Og8kQ9nd/wmAfbzd/r/b9cqtLPBw 5/WKncvjd1zXivQ+3fgXiPX2UtCZPSCIWDraCRRrelFO75PePz Aqd4+OIrFPBpxh2Q0mhD6nQqDXH X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -3.5 (---) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -3.5 (---)
Hi,

I=20found=20two=20(sema= ntically=20related)=20bugs.=20One=20seems=20to=20originate=20in=20the=20fir= st=20version.=20For=20research=20purposes,=20I=20would=20appreciate=20if=20= you=20could=20confirm=20that=20the=20second=20was=20introduced=20with=20Cor= eutils=205.3.0.

1)=20The=20following=20bug= =20seems=20to=20exists=20"since=20the=20beginning".
$echo=201234567890=20|=20./cut=20-b=202-,3,4-4,5,9-
3590
$echo=201234567890=20|=20./cut=20-b=202-,3,4-4,5,9-10
2345678= 90
$echo=201234567890=20|=20./cut=20-b=202-10,3,4-4= ,5,9-
234567890

2)=20Can=20you=20kindly= =20confirm=20that=20the=20following=20bug=20has=20been=20introduced=20with= =20Coreutils=205.3.0,=20particularly=20commit=20http://git.savannah.gnu.org= /gitweb/?p=3Dcoreutils.git;a=3Dcommit;h=3D7380cf792aa35b9328519c5f374036d52= 60704cb=20?
$echo=201234567890=20|=20./cut=20-b=202= -,3,4-4,5=20--output-delimiter=3D"."
2.34.567890
$echo=201234567890=20|=20./cut=20-b=202-10,3,4-4,5=20--output-d= elimiter=3D"."
234567890

Best=20regards,<= br/>
 Marcel
From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 24 02:13:10 2012 Received: (at 12966) by debbugs.gnu.org; 24 Nov 2012 07:13:10 +0000 Received: from localhost ([127.0.0.1]:35774 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tc9vJ-0002d3-Qv for submit@debbugs.gnu.org; Sat, 24 Nov 2012 02:13:10 -0500 Received: from mx.meyering.net ([88.168.87.75]:46951) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tc9vG-0002cv-Nn for 12966@debbugs.gnu.org; Sat, 24 Nov 2012 02:13:08 -0500 Received: from rho.meyering.net (rho.meyering.net [127.0.0.1]) by rho.meyering.net (Acme Bit-Twister) with ESMTP id D036C6011C; Sat, 24 Nov 2012 08:11:34 +0100 (CET) From: Jim Meyering To: =?iso-8859-1?Q?Marcel_B=F6hme?= Subject: Re: bug#12966: cut: Problems with overlapping, open-ended ranges In-Reply-To: ("Marcel \=\?iso-8859-1\?Q\?B\=F6hme\=22's\?\= message of "Fri, 23 Nov 2012 09:11:46 +0100 (CET)") References: Date: Sat, 24 Nov 2012 08:11:34 +0100 Message-ID: <871ufj79w9.fsf@rho.meyering.net> Lines: 99 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 12966 Cc: 12966@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.6 (----) Marcel B=F6hme wrote: > I found two (semantically related) bugs. One seems to originate in the > first version. For research purposes, I would appreciate if you could > confirm that the second was introduced with Coreutils 5.3.0. > 1) The following bug seems to exists "since the beginning". > $echo 1234567890 | ./cut -b 2-,3,4-4,5,9- > 3590 > $echo 1234567890 | ./cut -b 2-,3,4-4,5,9-10 > 234567890 > $echo 1234567890 | ./cut -b 2-10,3,4-4,5,9- > 234567890 Thank you for the reports! That is definitely a bug. Here's a proposed fix: [I'll look at the other one tomorrow if no one gets to it first. ] >From 99084373fb7a12888234958ff0961643cf029dae Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 23 Nov 2012 23:09:10 -0800 Subject: [PATCH] cut: interpret "-b3-,2-" like "-b2-", not like "-b3-" MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-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 test to exercise this. * THANKS.in: Attribute. * NEWS (Bug fixes): Mention it. Reported by Marcel B=F6hme in http://bugs.gnu.org/12966 --- NEWS | 4 ++++ THANKS.in | 1 + src/cut.c | 6 ++++-- tests/misc/cut.pl | 3 +++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 15fddd4..284525e 100644 --- a/NEWS +++ b/NEWS @@ -14,6 +14,10 @@ GNU coreutils NEWS -*= - outline -*- Instead, cut now fails and emits an appropriate diagnostic. [This bug was present in "the beginning".] + cut now handles overlapping right-open-ended ranges properly. Before, + it would interpret "-b3-,2-" like "-b3-". Now it's treated like "-b2-". + [This bug was present in "the beginning".] + install -m M SOURCE DEST no longer has a race condition where DEST's permissions are temporarily derived from SOURCE instead of from M. diff --git a/THANKS.in b/THANKS.in index 016a41e..3080cd3 100644 --- a/THANKS.in +++ b/THANKS.in @@ -367,6 +367,7 @@ Marc Haber mh+debian-bugs@zugs= chlus.de Marc Mengel mengel@fnal.gov Marc Lehman schmorp@schmorp.de Marc Olzheim marcolz@stack.nl +Marcel B=F6hme hawkie@web.de Marco Franzen Marco.Franzen@Thyron.com Marcus Brinkmann http://www.marcus-brinkmann.de Marcus Daniels marcus@ee.pdx.edu diff --git a/src/cut.c b/src/cut.c index 2a57148..b464840 100644 --- a/src/cut.c +++ b/src/cut.c @@ -391,8 +391,10 @@ set_fields (const char *fieldstr) In any case, 'initial' contains the start of the range. */ if (!rhs_specified) { - /* 'n-'. From 'initial' to end of line. */ - eol_range_start =3D initial; + /* 'n-'. From 'initial' to end of line. If we've alrea= dy + seen an M- range, ignore subsequent N- unless N < M. = */ + if (eol_range_start =3D=3D 0 || initial < eol_range_star= t) + eol_range_start =3D initial; field_found =3D true; } else diff --git a/tests/misc/cut.pl b/tests/misc/cut.pl index cd56555..cb4781a 100755 --- a/tests/misc/cut.pl +++ b/tests/misc/cut.pl @@ -163,6 +163,9 @@ my @Tests =3D ['big-unbounded-b', '--output-d=3D:', '-b1234567890-', {IN=3D>''}, {OUT= =3D>''}], ['big-unbounded-c', '--output-d=3D:', '-c1234567890-', {IN=3D>''}, {OUT= =3D>''}], ['big-unbounded-f', '--output-d=3D:', '-f1234567890-', {IN=3D>''}, {OUT= =3D>''}], + + ['overlapping-unbounded-1', '-b3-,2-', {IN=3D>"1234\n"}, {OUT=3D>"234\n"= }], + ['overlapping-unbounded-2', '-b2-,3-', {IN=3D>"1234\n"}, {OUT=3D>"234\n"= }], ); if ($mb_locale ne 'C') -- 1.8.0.251.g3a189da From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 24 03:45:14 2012 Received: (at 12966) by debbugs.gnu.org; 24 Nov 2012 08:45:14 +0000 Received: from localhost ([127.0.0.1]:35849 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TcBMP-0004k3-I8 for submit@debbugs.gnu.org; Sat, 24 Nov 2012 03:45:14 -0500 Received: from mout.web.de ([212.227.15.4]:49670) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TcBMM-0004ju-HN for 12966@debbugs.gnu.org; Sat, 24 Nov 2012 03:45:12 -0500 Received: from [10.238.63.27] ([119.234.1.19]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0MDgPG-1TSsis1oUw-00HEPU; Sat, 24 Nov 2012 09:43:38 +0100 References: <871ufj79w9.fsf@rho.meyering.net> In-Reply-To: <871ufj79w9.fsf@rho.meyering.net> Mime-Version: 1.0 (1.0) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Message-Id: X-Mailer: iPhone Mail (9B206) From: Marcel Boehme Subject: Re: bug#12966: cut: Problems with overlapping, open-ended ranges Date: Sat, 24 Nov 2012 16:45:39 +0800 To: Jim Meyering X-Provags-ID: V02:K0:XBk8UwHziFCfk3N7NcJt+ogW9PClId41rFLaGQs4gsm UmOYskblje2U2aCN6YelHYaPcNk5KVAti4BcTX4PwFb+hQ0H8C Oam+SvWbxdiz+VCTD7W+CsnpBvXXOmoKs2DfySKVH/VDei2c47 IOQuKmygoUgqj2SG2WhzO/iMgttQSA2c0Nmuyi7fruwHwcGm0m 8q7cAf7a22uD7H1bb/z3w== X-Spam-Score: 1.8 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Dear Mr. Meyering, If adding me to THANKS, could you kindly point to: http://www.comp.nus.edu.sg/~mboehme instead of my (spam) email address? Thank you very much indeed! Great work! [...] Content analysis details: (1.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (hawkie[at]web.de) 1.3 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net [Blocked - see ] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.15.4 listed in list.dnswl.org] -0.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% [score: 0.5000] 0.0 MIME_QP_LONG_LINE RAW: Quoted-printable line longer than 76 chars X-Debbugs-Envelope-To: 12966 Cc: "12966@debbugs.gnu.org" <12966@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 1.8 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Dear Mr. Meyering, If adding me to THANKS, could you kindly point to: http://www.comp.nus.edu.sg/~mboehme instead of my (spam) email address? Thank you very much indeed! Great work! [...] Content analysis details: (1.8 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RCVD_IN_BL_SPAMCOP_NET RBL: Received via a relay in bl.spamcop.net [Blocked - see ] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [212.227.15.4 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (hawkie[at]web.de) -0.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% [score: 0.4989] 0.0 MIME_QP_LONG_LINE RAW: Quoted-printable line longer than 76 chars Dear Mr. Meyering, If adding me to THANKS, could you kindly point to: http://www.comp.nus.edu.s= g/~mboehme instead of my (spam) email address? Thank you very much indeed! Great work! Best regards, Marcel On 24 Nov, 2012, at 3:11 PM, Jim Meyering wrote: > Marcel B=C3=B6hme wrote: >> I found two (semantically related) bugs. One seems to originate in the >> first version. For research purposes, I would appreciate if you could >> confirm that the second was introduced with Coreutils 5.3.0. >> 1) The following bug seems to exists "since the beginning". >> $echo 1234567890 | ./cut -b 2-,3,4-4,5,9- >> 3590 >> $echo 1234567890 | ./cut -b 2-,3,4-4,5,9-10 >> 234567890 >> $echo 1234567890 | ./cut -b 2-10,3,4-4,5,9- >> 234567890 >=20 > Thank you for the reports! That is definitely a bug. > Here's a proposed fix: > [I'll look at the other one tomorrow if no one > gets to it first. ] >=20 > =46rom 99084373fb7a12888234958ff0961643cf029dae Mon Sep 17 00:00:00 2001 > From: Jim Meyering > Date: Fri, 23 Nov 2012 23:09:10 -0800 > Subject: [PATCH] cut: interpret "-b3-,2-" like "-b2-", not like "-b3-" > MIME-Version: 1.0 > Content-Type: text/plain; charset=3DUTF-8 > Content-Transfer-Encoding: 8bit >=20 > * 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 test to exercise this. > * THANKS.in: Attribute. > * NEWS (Bug fixes): Mention it. > Reported by Marcel B=C3=B6hme in http://bugs.gnu.org/12966 > --- > NEWS | 4 ++++ > THANKS.in | 1 + > src/cut.c | 6 ++++-- > tests/misc/cut.pl | 3 +++ > 4 files changed, 12 insertions(+), 2 deletions(-) >=20 > diff --git a/NEWS b/NEWS > index 15fddd4..284525e 100644 > --- a/NEWS > +++ b/NEWS > @@ -14,6 +14,10 @@ GNU coreutils NEWS -= *- outline -*- > Instead, cut now fails and emits an appropriate diagnostic. > [This bug was present in "the beginning".] >=20 > + cut now handles overlapping right-open-ended ranges properly. Before, > + it would interpret "-b3-,2-" like "-b3-". Now it's treated like "-b2-"= . > + [This bug was present in "the beginning".] > + > install -m M SOURCE DEST no longer has a race condition where DEST's > permissions are temporarily derived from SOURCE instead of from M. >=20 > diff --git a/THANKS.in b/THANKS.in > index 016a41e..3080cd3 100644 > --- a/THANKS.in > +++ b/THANKS.in > @@ -367,6 +367,7 @@ Marc Haber mh+debian-bugs@zug= schlus.de > Marc Mengel mengel@fnal.gov > Marc Lehman schmorp@schmorp.de > Marc Olzheim marcolz@stack.nl > +Marcel B=C3=B6hme hawkie@web.de > Marco Franzen Marco.Franzen@Thyron.com > Marcus Brinkmann http://www.marcus-brinkmann.de > Marcus Daniels marcus@ee.pdx.edu > diff --git a/src/cut.c b/src/cut.c > index 2a57148..b464840 100644 > --- a/src/cut.c > +++ b/src/cut.c > @@ -391,8 +391,10 @@ set_fields (const char *fieldstr) > In any case, 'initial' contains the start of the range. *= / > if (!rhs_specified) > { > - /* 'n-'. =46rom 'initial' to end of line. */ > - eol_range_start =3D initial; > + /* 'n-'. =46rom 'initial' to end of line. If we've al= ready > + seen an M- range, ignore subsequent N- unless N < M.= */ > + if (eol_range_start =3D=3D 0 || initial < eol_range_sta= rt) > + eol_range_start =3D initial; > field_found =3D true; > } > else > diff --git a/tests/misc/cut.pl b/tests/misc/cut.pl > index cd56555..cb4781a 100755 > --- a/tests/misc/cut.pl > +++ b/tests/misc/cut.pl > @@ -163,6 +163,9 @@ my @Tests =3D > ['big-unbounded-b', '--output-d=3D:', '-b1234567890-', {IN=3D>''}, {OUT=3D= >''}], > ['big-unbounded-c', '--output-d=3D:', '-c1234567890-', {IN=3D>''}, {OUT=3D= >''}], > ['big-unbounded-f', '--output-d=3D:', '-f1234567890-', {IN=3D>''}, {OUT=3D= >''}], > + > + ['overlapping-unbounded-1', '-b3-,2-', {IN=3D>"1234\n"}, {OUT=3D>"234\n= "}], > + ['overlapping-unbounded-2', '-b2-,3-', {IN=3D>"1234\n"}, {OUT=3D>"234\n= "}], > ); >=20 > if ($mb_locale ne 'C') > -- > 1.8.0.251.g3a189da From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 24 07:17:10 2012 Received: (at 12966) by debbugs.gnu.org; 24 Nov 2012 12:17:10 +0000 Received: from localhost ([127.0.0.1]:36051 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TcEfV-00018y-QS for submit@debbugs.gnu.org; Sat, 24 Nov 2012 07:17:10 -0500 Received: from moutng.kundenserver.de ([212.227.126.187]:53316) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TcEfR-00018o-Jo for 12966@debbugs.gnu.org; Sat, 24 Nov 2012 07:17:07 -0500 Received: from [192.168.1.11] (p4FF76724.dip.t-dialin.net [79.247.103.36]) by mrelayeu.kundenserver.de (node=mrbap1) with ESMTP (Nemesis) id 0LsftZ-1TECXV3p97-0126Rd; Sat, 24 Nov 2012 13:15:33 +0100 Message-ID: <50B0BA63.5020103@bernhard-voelker.de> Date: Sat, 24 Nov 2012 13:15:31 +0100 From: Bernhard Voelker User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121025 Thunderbird/16.0.2 MIME-Version: 1.0 To: Jim Meyering Subject: Re: bug#12966: cut: Problems with overlapping, open-ended ranges References: <871ufj79w9.fsf@rho.meyering.net> In-Reply-To: <871ufj79w9.fsf@rho.meyering.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Provags-ID: V02:K0:GMEOnbgjFtHeEgzJEYhUhu2NkHw+mXP3XgUGWfErz8R qRWb2bCF4naXgr/JCXV9GSs1DfcHUb6gImKphKpeeejr6nqxB1 wQtP+R47GDD1Nq0MiOezyS4SRKjsfPOtfKMttwP1ApYtqB/fb9 xui7WPGC4/NUIhmdizwLUDXceCM+N5O7OU32BPjoavuSZV4qZi vzp8PgVMD16yQyR33RHY8qczUAXnlKzwUYyhalWYfv/7Mx27uZ P193nOlQG/4y4LCHumGjmRDbCDN18S3Lf2/az0VCRUNIhY9kOv SwzM5QUamtpX/Yv5DVBEJKJzw3mzryPOgB3V+gXGHCEW5eO1md hxftvy8Ib80bYsn1hGYhOIIENUG53bdL0q3WopHDb X-Spam-Score: 0.8 (/) X-Debbugs-Envelope-To: 12966 Cc: 12966@debbugs.gnu.org, =?ISO-8859-1?Q?Marcel_B=F6hme?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 0.8 (/) On 11/24/2012 08:11 AM, Jim Meyering wrote: > Subject: [PATCH] cut: interpret "-b3-,2-" like "-b2-", not like "-b3-" Isn't it the other way round? I.e. "-b3-,2-" has already been working correctly. - Subject: [PATCH] cut: interpret "-b3-,2-" like "-b2-", not like "-b3-" + Subject: [PATCH] cut: interpret "-b2-,3-" like "-b2-", not like "-b3-" > diff --git a/NEWS b/NEWS > index 15fddd4..284525e 100644 > --- a/NEWS > +++ b/NEWS > @@ -14,6 +14,10 @@ GNU coreutils NEWS -*- outline -*- > Instead, cut now fails and emits an appropriate diagnostic. > [This bug was present in "the beginning".] > > + cut now handles overlapping right-open-ended ranges properly. Before, > + it would interpret "-b3-,2-" like "-b3-". Now it's treated like "-b2-". > + [This bug was present in "the beginning".] > + Likewise. > diff --git a/THANKS.in b/THANKS.in > index 016a41e..3080cd3 100644 > --- a/THANKS.in > +++ b/THANKS.in > @@ -367,6 +367,7 @@ Marc Haber mh+debian-bugs@zugschlus.de > Marc Mengel mengel@fnal.gov > Marc Lehman schmorp@schmorp.de > Marc Olzheim marcolz@stack.nl > +Marcel Böhme hawkie@web.de > Marco Franzen Marco.Franzen@Thyron.com > Marcus Brinkmann http://www.marcus-brinkmann.de > Marcus Daniels marcus@ee.pdx.edu That change will conflict with Padraig's pending patch for http://bugs.gnu.org/12959. Otherwise, the patch looks good. BTW: interestingly, the i18n patch of openSuSE downstream already had such a fix included for ages (line 215): https://build.opensuse.org/package/view_file?file=coreutils-i18n.patch&package=coreutils&project=Base%3ASystem Have a nice day, Berny From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 24 11:49:46 2012 Received: (at 12966) by debbugs.gnu.org; 24 Nov 2012 16:49:46 +0000 Received: from localhost ([127.0.0.1]:36854 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TcIvK-0008Ei-FE for submit@debbugs.gnu.org; Sat, 24 Nov 2012 11:49:46 -0500 Received: from mx.meyering.net ([88.168.87.75]:47655) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TcIvI-0008EZ-DP for 12966@debbugs.gnu.org; Sat, 24 Nov 2012 11:49:45 -0500 Received: from rho.meyering.net (rho.meyering.net [127.0.0.1]) by rho.meyering.net (Acme Bit-Twister) with ESMTP id 70A7C600DF; Sat, 24 Nov 2012 17:48:10 +0100 (CET) From: Jim Meyering To: Marcel Boehme Subject: Re: bug#12966: cut: Problems with overlapping, open-ended ranges In-Reply-To: (Marcel Boehme's message of "Sat, 24 Nov 2012 16:45:39 +0800") References: <871ufj79w9.fsf@rho.meyering.net> Date: Sat, 24 Nov 2012 17:48:10 +0100 Message-ID: <87k3tb54mt.fsf@rho.meyering.net> Lines: 12 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 12966 Cc: "12966@debbugs.gnu.org" <12966@debbugs.gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) Marcel Boehme wrote: > If adding me to THANKS, could you kindly point to: > http://www.comp.nus.edu.sg/~mboehme instead of my (spam) email > address? P=E1draig already listed your name and URL for your seq report, so the addition (with your email address) in my change-set can simply be removed. > Thank you very much indeed! Great work! Thank you for finding/reporting all of those bugs. From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 24 12:02:54 2012 Received: (at 12966) by debbugs.gnu.org; 24 Nov 2012 17:02:54 +0000 Received: from localhost ([127.0.0.1]:36876 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TcJ82-00006e-3p for submit@debbugs.gnu.org; Sat, 24 Nov 2012 12:02:54 -0500 Received: from mx.meyering.net ([88.168.87.75]:47667) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TcJ7y-00006W-RS for 12966@debbugs.gnu.org; Sat, 24 Nov 2012 12:02:52 -0500 Received: from rho.meyering.net (rho.meyering.net [127.0.0.1]) by rho.meyering.net (Acme Bit-Twister) with ESMTP id 5986B64210; Sat, 24 Nov 2012 18:01:17 +0100 (CET) From: Jim Meyering To: Bernhard Voelker Subject: Re: bug#12966: cut: Problems with overlapping, open-ended ranges In-Reply-To: <50B0BA63.5020103@bernhard-voelker.de> (Bernhard Voelker's message of "Sat, 24 Nov 2012 13:15:31 +0100") References: <871ufj79w9.fsf@rho.meyering.net> <50B0BA63.5020103@bernhard-voelker.de> Date: Sat, 24 Nov 2012 18:01:17 +0100 Message-ID: <87ehjj540y.fsf@rho.meyering.net> Lines: 76 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 12966 Cc: 12966@debbugs.gnu.org, Marcel =?iso-8859-1?Q?B=F6hme?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.6 (----) Bernhard Voelker wrote: > On 11/24/2012 08:11 AM, Jim Meyering wrote: > >> Subject: [PATCH] cut: interpret "-b3-,2-" like "-b2-", not like "-b3-" > > Isn't it the other way round? I.e. "-b3-,2-" has already been working > correctly. > > - Subject: [PATCH] cut: interpret "-b3-,2-" like "-b2-", not like "-b3-" > + Subject: [PATCH] cut: interpret "-b2-,3-" like "-b2-", not like "-b3-" It most definitely is. Good catch. I've dropped the double quotes, too. They were useful in an earlier version that had a space after each -b, but now they add useless clutter. >> diff --git a/NEWS b/NEWS >> index 15fddd4..284525e 100644 >> --- a/NEWS >> +++ b/NEWS >> @@ -14,6 +14,10 @@ GNU coreutils NEWS -*- outline -*- >> Instead, cut now fails and emits an appropriate diagnostic. >> [This bug was present in "the beginning".] >> >> + cut now handles overlapping right-open-ended ranges properly. Before, >> + it would interpret "-b3-,2-" like "-b3-". Now it's treated like "-b2= -". >> + [This bug was present in "the beginning".] >> + > > Likewise. Yep. >> diff --git a/THANKS.in b/THANKS.in >> index 016a41e..3080cd3 100644 >> --- a/THANKS.in >> +++ b/THANKS.in >> @@ -367,6 +367,7 @@ Marc Haber mh+debian-bugs@zugschlus.de >> Marc Mengel mengel@fnal.gov >> Marc Lehman schmorp@schmorp.de >> Marc Olzheim marcolz@stack.nl >> +Marcel B=F6hme hawkie@web.de >> Marco Franzen Marco.Franzen@Thyron.com >> Marcus Brinkmann http://www.marcus-brinkmann.de >> Marcus Daniels marcus@ee.pdx.edu > > That change will conflict with Padraig's pending patch for > http://bugs.gnu.org/12959. Yes. Now that he's pushed that, I've simply removed the above delta from my change set. > Otherwise, the patch looks good. Thanks for the review. > BTW: interestingly, the i18n patch of openSuSE downstream > already had such a fix included for ages (line 215): > https://build.opensuse.org/package/view_file?file=3Dcoreutils-i18n.patch&= package=3Dcoreutils&project=3DBase%3ASystem Oh. I wish that whoever fixed that had let us know. For reference, here's the actual patch: if (!rhs_specified) { /* 'n-'. From 'initial' to end of line. */ - eol_range_start =3D initial; + if (eol_range_start =3D=3D 0 || + (eol_range_start !=3D 0 && eol_range_start > initial= )) + eol_range_start =3D initial; field_found =3D true; } BTW, I'll bet there's a static analysis tool that would warn about its redundant test, "eol_range_start !=3D 0" From debbugs-submit-bounces@debbugs.gnu.org Sat Nov 24 14:42:03 2012 Received: (at 12966) by debbugs.gnu.org; 24 Nov 2012 19:42:03 +0000 Received: from localhost ([127.0.0.1]:36971 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TcLc3-0004dr-59 for submit@debbugs.gnu.org; Sat, 24 Nov 2012 14:42:03 -0500 Received: from mx.meyering.net ([88.168.87.75]:47816) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TcLbw-0004dL-0z for 12966@debbugs.gnu.org; Sat, 24 Nov 2012 14:41:58 -0500 Received: from rho.meyering.net (rho.meyering.net [127.0.0.1]) by rho.meyering.net (Acme Bit-Twister) with ESMTP id 88F31600B1; Sat, 24 Nov 2012 20:40:21 +0100 (CET) From: Jim Meyering To: =?iso-8859-1?Q?Marcel_B=F6hme?= Subject: Re: bug#12966: cut: Problems with overlapping, open-ended ranges In-Reply-To: ("Marcel \=\?iso-8859-1\?Q\?B\=F6hme\=22's\?\= message of "Fri, 23 Nov 2012 09:11:46 +0100 (CET)") References: Date: Sat, 24 Nov 2012 20:40:21 +0100 Message-ID: <878v9q6b8a.fsf@rho.meyering.net> Lines: 107 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 12966 Cc: 12966@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.6 (----) Marcel B=F6hme wrote: > I found two (semantically related) bugs. One seems to originate in the > first version. For research purposes, I would appreciate if you could > confirm that the second was introduced with Coreutils 5.3.0. > 1) The following bug seems to exists "since the beginning". As you saw, I've posted a patch for that separately. > 2) Can you kindly confirm that the following bug has been introduced > with Coreutils 5.3.0, particularly commit > http://git.savannah.gnu.org/gitweb/?p=3Dcoreutils.git;a=3Dcommit;h=3D7= 380cf79 > 2aa35b9328519c5f374036d5260704cb ? > $echo 1234567890 | ./cut -b 2-,3,4-4,5 --output-delimiter=3D"." > 2.34.567890 > $echo 1234567890 | ./cut -b 2-10,3,4-4,5 --output-delimiter=3D"." > 234567890 Yes, that's another bug. Thanks again. Here's a proposed patch: >From 7fce8c5bd9a916b65895b159caa6632b076fc634 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 24 Nov 2012 11:36:15 -0800 Subject: [PATCH] cut: do not print extraneous delimiters in some unusual ca= ses MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit 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 test to exercise this. * NEWS (Bug fixes): Mention it. Reported by Marcel B=F6hme in http://bugs.gnu.org/12966 --- NEWS | 4 ++++ src/cut.c | 9 +++++---- tests/misc/cut.pl | 9 +++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index c46be61..9d0f2cf 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,10 @@ GNU coreutils NEWS -*= - outline -*- it would interpret "-b2-,3-" like "-b3-". Now it's treated like "-b2-". [This bug was present in "the beginning".] + cut no longer prints extraneous delimiters when a to-EOL range subsumes + another range. Before, "echo 123|cut --output-delim=3D: -b2-,3" would p= rint + "2:3". Now it prints "23". [bug introduced in 5.3.0] + install -m M SOURCE DEST no longer has a race condition where DEST's permissions are temporarily derived from SOURCE instead of from M. diff --git a/src/cut.c b/src/cut.c index b464840..4219d24 100644 --- a/src/cut.c +++ b/src/cut.c @@ -514,17 +514,18 @@ set_fields (const char *fieldstr) /* Set the array entries corresponding to integers in the ranges of RP. = */ for (i =3D 0; i < n_rp; i++) { - size_t j; - size_t rsi_candidate; + /* Ignore any range that is subsumed by the to-EOL range. */ + if (eol_range_start && eol_range_start <=3D rp[i].lo) + continue; /* Record the range-start indices, i.e., record each start index that is not part of any other (lo..hi] range. */ - rsi_candidate =3D complement ? rp[i].hi + 1 : rp[i].lo; + size_t rsi_candidate =3D complement ? rp[i].hi + 1 : rp[i].lo; if (output_delimiter_specified && !is_printable_field (rsi_candidate)) mark_range_start (rsi_candidate); - for (j =3D rp[i].lo; j <=3D rp[i].hi; j++) + for (size_t j =3D rp[i].lo; j <=3D rp[i].hi; j++) mark_printable_field (j); } diff --git a/tests/misc/cut.pl b/tests/misc/cut.pl index cb4781a..27768ff 100755 --- a/tests/misc/cut.pl +++ b/tests/misc/cut.pl @@ -166,6 +166,15 @@ my @Tests =3D ['overlapping-unbounded-1', '-b3-,2-', {IN=3D>"1234\n"}, {OUT=3D>"234\n"= }], ['overlapping-unbounded-2', '-b2-,3-', {IN=3D>"1234\n"}, {OUT=3D>"234\n"= }], + + # When printing output delimiters, and with one or more ranges subsumed + # by a to-EOL range, cut 8.20 and earlier would print extraneous delimit= ers. + ['EOL-subsumed-1', '--output-d=3D: -b2-,3,4-4,5', + {IN=3D>"123456\n"}, {OUT=3D>"2345= 6\n"}], + ['EOL-subsumed-2', '--output-d=3D: -b3,4-4,5,2-', + {IN=3D>"123456\n"}, {OUT=3D>"2345= 6\n"}], + ['EOL-subsumed-3', '--complement -b3,4-4,5,2-', + {IN=3D>"123456\n"}, {OUT=3D>"1\n"= }], ); if ($mb_locale ne 'C') -- 1.8.0.273.g2d242fb From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 25 07:07:12 2012 Received: (at 12966) by debbugs.gnu.org; 25 Nov 2012 12:07:12 +0000 Received: from localhost ([127.0.0.1]:37609 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TcazQ-0004Ts-6J for submit@debbugs.gnu.org; Sun, 25 Nov 2012 07:07:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:20767) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TcazN-0004Tj-F1 for 12966@debbugs.gnu.org; Sun, 25 Nov 2012 07:07:10 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qAPC5UBW020690 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 25 Nov 2012 07:05:30 -0500 Received: from [10.36.116.25] (ovpn-116-25.ams2.redhat.com [10.36.116.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qAPC5RjS022380 (version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 25 Nov 2012 07:05:29 -0500 Message-ID: <50B20988.6050701@draigBrady.com> Date: Sun, 25 Nov 2012 12:05:28 +0000 From: =?ISO-8859-1?Q?P=E1draig_Brady?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 MIME-Version: 1.0 To: Jim Meyering Subject: Re: bug#12966: cut: Problems with overlapping, open-ended ranges References: <878v9q6b8a.fsf@rho.meyering.net> In-Reply-To: <878v9q6b8a.fsf@rho.meyering.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Content-Transfer-Encoding: quoted-printable X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id qAPC5UBW020690 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: 12966 Cc: 12966@debbugs.gnu.org, =?ISO-8859-1?Q?Marcel_B=F6hme?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.5 (-----) On 11/24/2012 07:40 PM, Jim Meyering wrote: > diff --git a/src/cut.c b/src/cut.c > index b464840..4219d24 100644 > --- a/src/cut.c > +++ b/src/cut.c > @@ -514,17 +514,18 @@ set_fields (const char *fieldstr) > /* Set the array entries corresponding to integers in the ranges of= RP. */ > for (i =3D 0; i < n_rp; i++) > { > - size_t j; > - size_t rsi_candidate; > + /* Ignore any range that is subsumed by the to-EOL range. */ > + if (eol_range_start && eol_range_start <=3D rp[i].lo) > + continue; looks good. thanks, P=E1draig. From debbugs-submit-bounces@debbugs.gnu.org Sun Nov 25 10:52:17 2012 Received: (at 12966-done) by debbugs.gnu.org; 25 Nov 2012 15:52:17 +0000 Received: from localhost ([127.0.0.1]:38324 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TceVF-00029x-Ap for submit@debbugs.gnu.org; Sun, 25 Nov 2012 10:52:17 -0500 Received: from mx.meyering.net ([88.168.87.75]:49036) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1TceVC-00029m-Fh for 12966-done@debbugs.gnu.org; Sun, 25 Nov 2012 10:52:15 -0500 Received: from rho.meyering.net (rho.meyering.net [127.0.0.1]) by rho.meyering.net (Acme Bit-Twister) with ESMTP id 51D56600B1; Sun, 25 Nov 2012 16:50:35 +0100 (CET) From: Jim Meyering To: =?iso-8859-1?Q?P=E1draig?= Brady Subject: Re: bug#12966: cut: Problems with overlapping, open-ended ranges In-Reply-To: <50B20988.6050701@draigBrady.com> (=?iso-8859-1?Q?=22P=E1drai?= =?iso-8859-1?Q?g?= Brady"'s message of "Sun, 25 Nov 2012 12:05:28 +0000") References: <878v9q6b8a.fsf@rho.meyering.net> <50B20988.6050701@draigBrady.com> Date: Sun, 25 Nov 2012 16:50:35 +0100 Message-ID: <87624t4r78.fsf@rho.meyering.net> Lines: 21 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -1.9 (-) X-Debbugs-Envelope-To: 12966-done Cc: 12966-done@debbugs.gnu.org, Marcel =?iso-8859-1?Q?B=F6hme?= X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -1.9 (-) P=E1draig Brady wrote: > On 11/24/2012 07:40 PM, Jim Meyering wrote: > >> diff --git a/src/cut.c b/src/cut.c >> index b464840..4219d24 100644 >> --- a/src/cut.c >> +++ b/src/cut.c >> @@ -514,17 +514,18 @@ set_fields (const char *fieldstr) >> /* Set the array entries corresponding to integers in the ranges of = RP. */ >> for (i =3D 0; i < n_rp; i++) >> { >> - size_t j; >> - size_t rsi_candidate; >> + /* Ignore any range that is subsumed by the to-EOL range. */ >> + if (eol_range_start && eol_range_start <=3D rp[i].lo) >> + continue; > > looks good. Pushed (and marked "done"). Thanks for the review. From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 28 13:09:37 2012 Received: (at submit) by debbugs.gnu.org; 28 Nov 2012 18:09:37 +0000 Received: from localhost ([127.0.0.1]:43992 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tdm4n-0004C0-0S for submit@debbugs.gnu.org; Wed, 28 Nov 2012 13:09:37 -0500 Received: from eggs.gnu.org ([208.118.235.92]:55396) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Tdm4k-0004Bt-Mt for submit@debbugs.gnu.org; Wed, 28 Nov 2012 13:09:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tdm2n-0007uR-JH for submit@debbugs.gnu.org; Wed, 28 Nov 2012 13:07:39 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:44030) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tdm2n-0007uN-GO for submit@debbugs.gnu.org; Wed, 28 Nov 2012 13:07:33 -0500 Received: from eggs.gnu.org ([208.118.235.92]:54405) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tdm2l-0000mv-5M for bug-coreutils@gnu.org; Wed, 28 Nov 2012 13:07:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tdm2d-0007nB-8a for bug-coreutils@gnu.org; Wed, 28 Nov 2012 13:07:31 -0500 Received: from cantor2.suse.de ([195.135.220.15]:60845 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tdm2d-0007gf-2I for bug-coreutils@gnu.org; Wed, 28 Nov 2012 13:07:23 -0500 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id B3DEAA30B9 for ; Wed, 28 Nov 2012 19:06:41 +0100 (CET) Date: Wed, 28 Nov 2012 19:06:41 +0100 From: Philipp Thomas To: bug-coreutils@gnu.org Subject: Re: bug#12966: cut: Problems with overlapping, open-ended ranges Message-ID: <20121128180641.GA9241@paradies.suse.de> References: <871ufj79w9.fsf@rho.meyering.net> <50B0BA63.5020103@bernhard-voelker.de> <87ehjj540y.fsf@rho.meyering.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87ehjj540y.fsf@rho.meyering.net> X-Operating-System: openSUSE - Kernel Linux 3.4.11-2.16-desktop x86_64 Organization: SUSE LINUX Products GmbH, =?iso-8859-1?Q?G?= =?iso-8859-1?Q?F=3A_Jeff_Hawn=2C_Jennifer_Guild=2C_Felix_Imend=F6rffer=2C?= =?iso-8859-1?Q?_HRB_21284_=28AG_N=FCrnberg=29?= User-Agent: Mutt/1.5.21 (2010-09-15) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 208.118.235.17 X-Spam-Score: -4.2 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.0 (-----) * Jim Meyering (jim@meyering.net) [20121124 18:02]: > Oh. I wish that whoever fixed that had let us know. I don't know who originated the i18n patch, but I took a newer version from ArchLinux because their maintainer had already adapted the rather huge patch to the then current coreutils version. That saved me lots of work as the patch is neccessarily rather intrusive. Philipp From unknown Thu Jun 19 16:24:33 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 27 Dec 2012 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator