From unknown Sun Jun 22 11:38:38 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#32494 <32494@debbugs.gnu.org> To: bug#32494 <32494@debbugs.gnu.org> Subject: Status: t incorrectly branching Reply-To: bug#32494 <32494@debbugs.gnu.org> Date: Sun, 22 Jun 2025 18:38:38 +0000 retitle 32494 t incorrectly branching reassign 32494 sed submitter 32494 Ruben Maes severity 32494 normal tag 32494 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 21 11:22:06 2018 Received: (at submit) by debbugs.gnu.org; 21 Aug 2018 15:22:07 +0000 Received: from localhost ([127.0.0.1]:56921 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fs8Tu-0007gr-Fr for submit@debbugs.gnu.org; Tue, 21 Aug 2018 11:22:06 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42648) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fs41l-0004s1-64 for submit@debbugs.gnu.org; Tue, 21 Aug 2018 06:36:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fs41f-00089O-DX for submit@debbugs.gnu.org; Tue, 21 Aug 2018 06:36:39 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:34293) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fs41f-00089D-8l for submit@debbugs.gnu.org; Tue, 21 Aug 2018 06:36:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fs41e-0007Zr-Ho for bug-sed@gnu.org; Tue, 21 Aug 2018 06:36:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fs41a-00083j-6v for bug-sed@gnu.org; Tue, 21 Aug 2018 06:36:38 -0400 Received: from www.neshema.com ([109.74.196.168]:38694 helo=neshema.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fs41Z-00081f-PE for bug-sed@gnu.org; Tue, 21 Aug 2018 06:36:34 -0400 Received: from localhost (linode.neshema.com [127.0.0.1]) by neshema.com (Postfix) with ESMTP id EBC2B233C3 for ; Tue, 21 Aug 2018 10:36:29 +0000 (UTC) Date: Tue, 21 Aug 2018 12:36:25 +0200 From: Ruben Maes To: Sed Bugs Subject: t incorrectly branching Message-ID: <20180821123625.5aaba3b6@localhost> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/sc8y0HR9_Cu_F4dtLez/Gak"; protocol="application/pgp-signature" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 21 Aug 2018 11:22:05 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.1 (-----) --Sig_/sc8y0HR9_Cu_F4dtLez/Gak Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable printf 'Hello\n' | sed ' s/foobar// t end s/Hello/Goodbye/ :end' This works as expected, it prints Goodbye. printf 'Hello\n' | sed ' s/Hello/Hello to you/ s/foobar// t end s/Hello/Goodbye/ :end' Since t should only look at whether the *last* substitution changed the pat= tern space, it is my understanding that this should print: Goodbye to you But sed prints instead: Hello to you If I got this right, that means there's a bug in sed =E2=80=93 maybe resett= ing the "last substitution was successful" flag isn't done properly? Or am = I misunderstanding something here after all? Tried on these versions, both did exactly the same: $ sed --version | head -n1 sed (GNU sed) 4.2.2 sed (GNU sed) 4.5 --Sig_/sc8y0HR9_Cu_F4dtLez/Gak Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEb8r2UyU6wvspl+1+HBJgNLxbm9oFAlt76ykACgkQHBJgNLxb m9on/Q/+NYsy+9DrSZkRBzd5BTZvJdk0d2ntVRi8yg7q53OZXgj9bwKbj3gzPOxs AeC3ELHeLkrKIxgeny+MuvrN3DmIhTrvAYWeBGV9NjGDqu38da2YM+n3xS5ZYV46 1s6JazfjoNcSqpFrW8IFftLf+xD3d9YC62+73PtcIkyjqtVGhX2yXJbfD/MobqKf 1I4xn5ZIi+n4lDut7AyDCQa4hKWX+LE4hQMxi/qk2h//LDzW7YMn321oBIB2bM6X ur1D/u56+pOStNREY53I0y6oYypUGpOn4oUmKZihxSHzYtcZS1Ojme4IsGgqsB0T i0QYMP90DlYGTefWEjml5ZvXXykfKuoM3O0xDo5Q3VMhN8le9yRksoEiHcqs3KGe kzzatsxlta740mdT2CjqTh210LFvo1QuqBjQjnNQbnawI8o2UgZWE471GCmJ54DM hjX61HdNo7mhcb2ifDE1cFGGXLHsE25gr3ofPMRzJI8VvKV44jNY6RXEHhoj+LSH U3XWsam9sYBUiMlZ6xynLwRQH/pu9QPz3fxoQiN8RbgIT9UDLr88OLICpm+aYxGh 39knEdazMLC90NAKq5JPX7KXKDzpCVGvE++vGqedA0qlEXCvZfNahdVD9qRi2YcM fItvnt7Dt3bP1Ev+9uOrtgLM+uZ4r00OllJ2Bh0bu3q3zIkDI3A= =ODuV -----END PGP SIGNATURE----- --Sig_/sc8y0HR9_Cu_F4dtLez/Gak-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 21 11:53:01 2018 Received: (at control) by debbugs.gnu.org; 21 Aug 2018 15:53:01 +0000 Received: from localhost ([127.0.0.1]:56952 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fs8xp-0008SD-AC for submit@debbugs.gnu.org; Tue, 21 Aug 2018 11:53:01 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:49750 helo=mx1.redhat.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fs8xm-0008Ru-I1; Tue, 21 Aug 2018 11:52:59 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 29B7C4021CC2; Tue, 21 Aug 2018 15:52:53 +0000 (UTC) Received: from [10.10.124.180] (ovpn-124-180.rdu2.redhat.com [10.10.124.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id A833E2166BA1; Tue, 21 Aug 2018 15:52:52 +0000 (UTC) Subject: Re: bug#32494: t incorrectly branching To: Ruben Maes , 32494-done@debbugs.gnu.org References: <20180821123625.5aaba3b6@localhost> From: Eric Blake Organization: Red Hat, Inc. Message-ID: <3e98f187-b4b8-cbc3-a3c9-ef92a8dd56ed@redhat.com> Date: Tue, 21 Aug 2018 10:52:52 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180821123625.5aaba3b6@localhost> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 21 Aug 2018 15:52:53 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Tue, 21 Aug 2018 15:52:53 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'eblake@redhat.com' RCPT:'' X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) tag 32494 notabug thanks On 08/21/2018 05:36 AM, Ruben Maes wrote: > printf 'Hello\n' | sed ' > s/Hello/Hello to you/ > s/foobar// > t end > s/Hello/Goodbye/ > :end' > > Since t should only look at whether the *last* substitution changed the pattern space, That's not how POSIX describes it: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/sed.html "[2addr]t [label] Test. Branch to the : command verb bearing the label if any substitutions have been made since the most recent reading of an input line or execution of a t. If label is not specified, branch to the end of the script." 'info sed' words it a bit differently: 't LABEL' Branch to LABEL only if there has been a successful 's'ubstitution since the last input line was read or conditional branch was taken. The LABEL may be omitted, in which case the next cycle is started. which seems to emphasize that the previous 't' must have been successfully taken before the condition gets reset (but if the last conditional 't' was not taken, then there has not been a successful match, so I don't know if the difference can be observed in practice). > it is my understanding that this should print: > Goodbye to you > But sed prints instead: > Hello to you sed is behaving correctly; it is your understanding that was off. It is not "branch if last substitution succeeded", but "branch if ANY substitution has succeeded since the last input or 't'". One possible fix to your script, then, is to bound any substitution that you want to test in isolation with an earlier 't', perhaps looking something like: t reset : reset s/...// t end such that whether or not 't reset' fires, execution resumes at s/// in question with the condition cleared. As such, I'm closing this as not a bug, but feel free to add more comments on the topic. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 21 12:00:19 2018 Received: (at submit) by debbugs.gnu.org; 21 Aug 2018 16:00:19 +0000 Received: from localhost ([127.0.0.1]:56962 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fs94t-0000Sb-7X for submit@debbugs.gnu.org; Tue, 21 Aug 2018 12:00:19 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45436) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fs4D3-00078s-1L for submit@debbugs.gnu.org; Tue, 21 Aug 2018 06:48:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fs4Cx-0002Lu-2t for submit@debbugs.gnu.org; Tue, 21 Aug 2018 06:48:19 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:43780) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fs4Cw-0002Ln-T0 for submit@debbugs.gnu.org; Tue, 21 Aug 2018 06:48:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fs4Cv-0003Gk-Sg for bug-sed@gnu.org; Tue, 21 Aug 2018 06:48:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fs4Cr-0002JQ-LE for bug-sed@gnu.org; Tue, 21 Aug 2018 06:48:17 -0400 Received: from www.neshema.com ([109.74.196.168]:38700 helo=neshema.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fs4Cr-0002IP-EG for bug-sed@gnu.org; Tue, 21 Aug 2018 06:48:13 -0400 Received: from localhost (linode.neshema.com [127.0.0.1]) by neshema.com (Postfix) with ESMTP id E65B1233E8 for ; Tue, 21 Aug 2018 10:48:10 +0000 (UTC) Date: Tue, 21 Aug 2018 12:48:09 +0200 From: Ruben Maes To: Sed Bugs Subject: Re: t incorrectly branching Message-ID: <20180821124810.3d7eb60e@localhost> In-Reply-To: <20180821123625.5aaba3b6@localhost> References: <20180821123625.5aaba3b6@localhost> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/cmO3lpW7O7vQbmK3gzneIMf"; protocol="application/pgp-signature" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 21 Aug 2018 12:00:18 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.1 (-----) --Sig_/cmO3lpW7O7vQbmK3gzneIMf Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Okay, nevermind. There's just a grave error in the tutorial http://www.grym= oire.com/Unix/Sed.html. t isn't defined to look at the last substitution, but at all substitutions = since the last input line was read and since the last t or T command. Sorry for the noise. --Sig_/cmO3lpW7O7vQbmK3gzneIMf Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEb8r2UyU6wvspl+1+HBJgNLxbm9oFAlt77eoACgkQHBJgNLxb m9pagRAAoXeF+qMPiHIlvbXZEYUWNtCx8PJW/i3fAUivNJx2Qn00RECUyIhfQbRZ LiMOWZfyVpo3D+QgSbcabcEr6mqkxRELfFLWFVVyPexJbApzq0q7wyVrxAwH3uFD xGMoWezLwUCBQwA9DD92mbm2xTZBfoSmnMlq4NzT8VpPdoi3zZ/+U9B4ZIjb4G8U /1whiT7UCkIs1UdBSghmbh7cK8eiT2iXu8j/1/nXAPbEJ8mzmd41+rdenXToxlaI LA850Pz1JORk48dMmifk7EEIeWwZESWp8oZORYN8uzXIiYDDYJIJslL0QhySKZ1+ L2OnBLET8nxPHA5Yhh1EhGrVcpRL8Xz0S+AfLhvsFnGK55Rhi47ulotv/J9UDBh3 poaZcpqIqsum4n22JynDO9DsGSvO+2QeehcGJECj9I67dk1TJ99aQjiLg3C1hHTF Ltrg+ScQhq3tyGNP89KXQWISBCbpcEm66qSitZ0ujpf6JMudaobxhhvq07P8PGPJ bPXHU+cX3yHzKQ7TX1F3LD0yN9G9dKHGwGyksrvi8C+88p5P43QGijl/Z+CAwJTw lqNctPfN0org9Pim9vMEf45cEUyznvskc799Z5IdQggWStETPW0WfVBN4auZFalp FaF0yvlKR2bYKY2Du5b0Vn8sW5jYgRbR4y3r3tMq1l3PCah7CJ0= =EKaz -----END PGP SIGNATURE----- --Sig_/cmO3lpW7O7vQbmK3gzneIMf-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 21 12:00:20 2018 Received: (at 32494) by debbugs.gnu.org; 21 Aug 2018 16:00:20 +0000 Received: from localhost ([127.0.0.1]:56964 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fs94t-0000Ss-KH for submit@debbugs.gnu.org; Tue, 21 Aug 2018 12:00:19 -0400 Received: from www.neshema.com ([109.74.196.168]:49532 helo=neshema.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fs8dZ-0007xK-IA for 32494@debbugs.gnu.org; Tue, 21 Aug 2018 11:32:05 -0400 Received: from localhost (linode.neshema.com [127.0.0.1]) by neshema.com (Postfix) with ESMTP id D58C7233F0 for <32494@debbugs.gnu.org>; Tue, 21 Aug 2018 15:31:59 +0000 (UTC) Date: Tue, 21 Aug 2018 17:31:55 +0200 From: Ruben Maes To: 32494@debbugs.gnu.org Subject: Re: t incorrectly branching Message-ID: <20180821173156.4a6f6463@localhost> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/7A1i1_Qu0Y=fouEdH6wvehA"; protocol="application/pgp-signature" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 32494 X-Mailman-Approved-At: Tue, 21 Aug 2018 12:00:19 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --Sig_/7A1i1_Qu0Y=fouEdH6wvehA Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Okay, nevermind. There's just a grave error in the tutorial http://www.grym= oire.com/Unix/Sed.html. t isn't defined to look at the last substitution, but at all substitutions = since the last input line was read and since the last t or T command. Sorry for the noise. --Sig_/7A1i1_Qu0Y=fouEdH6wvehA Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEb8r2UyU6wvspl+1+HBJgNLxbm9oFAlt8MGwACgkQHBJgNLxb m9oE3hAAmwBDrwQ8LCyfhKD1aXbdJgQSImO+Xoklg/fhpvYEf4/cD80O0kGDCBdC uk+cRnwuWaPUIEL4qupnq9+8oy6BhSe8RsfLrufMU9W6mt44YUBtnoH2Iy22XNSc lHPJroWDDcxkqwcRho4RRtoEDLO3tOtkTyfP9p355+EmYWXphOZUObx+uW/UJgk+ CM61ydIcnIh5B6K+jJsW0Kbg0Hj8u66BQFVzOIzfKG7dTs6xSnHJV58jwOZZHySv 7N3X0o8sGYSjgjVvIcFhWH8+r1ZiXm9I+l46Cc1EtkXGyqzc5gdxbofbNQbMSFbh L6Ha1kpIbpx3ogG6nE58oNZcSbo1h/WYrYfDMOCVDdUs4Qnh1G7GMkS1IQLknQbD uvgXK2n40RNBpHKlLmMzZUNaiknUHl3bM5s6m6B9u6VRrWIN2PcuVDljcczAcV54 tKEysZ+YvUDgxVCJJh0DLJzyNUZ9aR4Q173F5UhoLNLdT6UhnA8Jc7wS6gvZvxY+ O7tkJZsCq0b31DLSVF3zPVotQvtXDHFm1E/H++Jd48D73pthAOS/5DxvqO0AWiei XAaeU8pf5mh+/OeDN6RwfdzIYJGL4TF17rvSuxEgqmohv0UFvo57NFCNmXLgJdlO LQHUdIPAJ4FOEXsvFwWBfT9Jpw8awXFTctYT+VZDRwgbBL0u5Hg= =/5nA -----END PGP SIGNATURE----- --Sig_/7A1i1_Qu0Y=fouEdH6wvehA-- From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 21 12:10:12 2018 Received: (at 32494) by debbugs.gnu.org; 21 Aug 2018 16:10:12 +0000 Received: from localhost ([127.0.0.1]:56980 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fs9ER-0002SF-O9 for submit@debbugs.gnu.org; Tue, 21 Aug 2018 12:10:12 -0400 Received: from mout.gmx.net ([212.227.15.19]:45973) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fs9EP-0002Ru-Oy for 32494@debbugs.gnu.org; Tue, 21 Aug 2018 12:10:10 -0400 Received: from zoot.sax ([84.88.50.104]) by mail.gmx.com (mrgmx002 [212.227.17.184]) with ESMTPSA (Nemesis) id 0Me8RK-1fTRrw1L4Q-00Pw4L; Tue, 21 Aug 2018 18:10:02 +0200 Date: Tue, 21 Aug 2018 18:09:58 +0200 From: Davide Brini To: Ruben Maes Subject: Re: bug#32494: t incorrectly branching In-Reply-To: <20180821123625.5aaba3b6@localhost> References: <20180821123625.5aaba3b6@localhost> X-Mailer: Claws Mail 3.17.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Message-ID: <0Lw285-1ftfkd1psb-017pSY@mail.gmx.com> X-Provags-ID: V03:K1:9e64HPS0ZtS9Eoy6vIw90GQmhff/7f2SHKKD5HFy4ZF73XCRu83 K/8vrvYZxisBuUjA+r+dtKxESeXIE2mwlauKQ0qJnmkLIvm34pX8FlFgLxRMb6FHGfqfAoX FJFw5AMPtBH99nPufzBT1G4C3HAUSRTLiqqhAgKpUjvbDNn7+pZbvvXgLO1Sk33hrKcczJ5 9WH+jYAPnF5uM4EUIST+A== X-UI-Out-Filterresults: notjunk:1;V01:K0:Ox/+P4Pz6Oo=:sNto2XurP4XGOh1xNk1102 8tcWxPl4JlyUIfD6yiHuXeqOjlM5fKy/8OtjESEMKy5Ys/LAbG59Td6TVU90yqN9KMj5aQP5Z AjW8pRpjvZRO3Jwi70PaxIgPRkcPbtFruN88PF0kXTexfZ/C+TEtuvyjx70GDkTykMrlbeNO6 Yq1uzR/SCsDq4OlgBMK6wHcZAnQnBCMOhmyd4ovZnujl8INehBnIXVWmk7hYJpFqPt5xsajov enf2uhRCekO0wHlFrIlr2yPqLb6jC0V68f9bQcbawaqYQaBuTPaGgF49hSK4Kd6S5biUHeyoE ShEEmxO1LN0kRCHD3khrAUUgVr5Hk9Kspf55pS1HVWiJ7XZ6AlK17L2ERthkzw89yKxA8XJ4D Zh6jPHZ2X5inwA+abLJ9OVANN1zvRyomnI27JZv3rcgbp/gCOFMhDvqgTpCWuJx2fSLloHq6q hIt3ueyqhzIJr8vKrlyamR0ppMmIXZ11R5DiYB+WCyV2p/V9wMEGxVM9QyVuaFWzB/KsB9MR0 v+JDk5Qz5jsToWLnQZdPZ8XycXzsnF8Rtu6tik8CLscGrbpj3d+XR+DaVR3wooOd6Px91Y3Z+ H+5TAR8So1J+HDykARn3QSi2aysK1tCbFJeoF9kO20OEUDXEvF1uYyBpL5+PKXg4itBj+Ushm FPepHtyrqCIFGN9lgpAM5uH8R14ugMEDOX7fXCqwiCpwLPe3wfIo4tKfl831mCH2+36DOgHKY Q7tBk1mXDBDfaJv9sGEjdP/pHtBcaOk6pk6pujMQvDk5M9vxt/qnuZR5gFDbYPb2Dck12P5R6 NirU1Cn X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 32494 Cc: 32494@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Tue, 21 Aug 2018 12:36:25 +0200, Ruben Maes wrote: > printf 'Hello\n' | sed ' > s/foobar// > t end > s/Hello/Goodbye/ > :end' >=20 > This works as expected, it prints Goodbye. >=20 >=20 > printf 'Hello\n' | sed ' > s/Hello/Hello to you/ > s/foobar// > t end > s/Hello/Goodbye/ > :end' >=20 > Since t should only look at whether the *last* substitution changed the > pattern space, it is my understanding that this should print: Goodbye to > you But sed prints instead: > Hello to you >=20 > If I got this right, that means there's a bug in sed =E2=80=93 maybe rese= tting > the "last substitution was successful" flag isn't done properly? Or am I > misunderstanding something here after all? Here's what the man says: "If a s/// has done a successful substitution since the last input line was read and since the last t or T command, then branch to label" The standard says: "Branch to the : command verb bearing the label if any substitutions have been made since the most recent reading of an input line or execution of a t. If label is not specified, branch to the end of the script." So it looks to me like sed is producing the expected behavior. --=20 D. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 21 12:55:16 2018 Received: (at 32494) by debbugs.gnu.org; 21 Aug 2018 16:55:16 +0000 Received: from localhost ([127.0.0.1]:56985 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fs9w4-0003Vy-Hb for submit@debbugs.gnu.org; Tue, 21 Aug 2018 12:55:16 -0400 Received: from www.neshema.com ([109.74.196.168]:49620 helo=neshema.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fs9w2-0003Vk-Cw for 32494@debbugs.gnu.org; Tue, 21 Aug 2018 12:55:14 -0400 Received: from localhost (linode.neshema.com [127.0.0.1]) by neshema.com (Postfix) with ESMTP id 8A4D9233F6 for <32494@debbugs.gnu.org>; Tue, 21 Aug 2018 16:55:08 +0000 (UTC) Date: Tue, 21 Aug 2018 18:55:07 +0200 From: Ruben Maes To: 32494@debbugs.gnu.org Subject: Re: bug#32494: t incorrectly branching Message-ID: <20180821185507.1126478b@localhost> In-Reply-To: References: <3e98f187-b4b8-cbc3-a3c9-ef92a8dd56ed@redhat.com> <20180821123625.5aaba3b6@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 32494 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Might I remark that your bug tracking system is frustratingly slow. I noticed the mistake pretty soon after my report and sent a reply 12 minutes after reporting. The initial report did not appear until almost an hour after I had sent it, and the follow-up message at least half an hour after that. From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 21 13:54:49 2018 Received: (at 32494) by debbugs.gnu.org; 21 Aug 2018 17:54:49 +0000 Received: from localhost ([127.0.0.1]:57003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fsArh-0006vX-Ia for submit@debbugs.gnu.org; Tue, 21 Aug 2018 13:54:49 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:34386 helo=mx1.redhat.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fsArd-0006vK-Jb for 32494@debbugs.gnu.org; Tue, 21 Aug 2018 13:54:46 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E76337D84D; Tue, 21 Aug 2018 17:54:39 +0000 (UTC) Received: from [10.10.124.180] (ovpn-124-180.rdu2.redhat.com [10.10.124.180]) by smtp.corp.redhat.com (Postfix) with ESMTP id A9A6D2026D64; Tue, 21 Aug 2018 17:54:39 +0000 (UTC) Subject: Re: bug#32494: t incorrectly branching To: Ruben Maes , 32494@debbugs.gnu.org References: <3e98f187-b4b8-cbc3-a3c9-ef92a8dd56ed@redhat.com> <20180821123625.5aaba3b6@localhost> <20180821185507.1126478b@localhost> From: Eric Blake Organization: Red Hat, Inc. Message-ID: <3aa83402-587f-0a7c-9aa7-3fc7a14adbc1@redhat.com> Date: Tue, 21 Aug 2018 12:54:39 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180821185507.1126478b@localhost> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 21 Aug 2018 17:54:39 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 21 Aug 2018 17:54:39 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'eblake@redhat.com' RCPT:'' X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 32494 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) On 08/21/2018 11:55 AM, Ruben Maes wrote: > Might I remark that your bug tracking system is frustratingly slow. I noticed the mistake pretty soon after my report and sent a reply 12 minutes after reporting. It may also be compounded by the human moderator queue responsible for letting first-time poster's messages through. While we tend to whitelist senders so that future messages don't need a human review, there's still a good chance that several initial messages from a new poster all pile up until someone actually has time to flush the queue. > > The initial report did not appear until almost an hour after I had sent it, and the follow-up message at least half an hour after that. Email is an interesting medium - it has great resiliency to temporary network outages, but at the expense of no real-time tracking and sometimes out-of-order delivery or or lengthy delays due to exponential back-off queuing choices at any number of hops along the way. -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org From unknown Sun Jun 22 11:38:38 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 19 Sep 2018 11:24:07 +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