From nobody Tue Dec 17 22:34:26 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YCWnt6c2Mz5hpb6; Tue, 17 Dec 2024 22:34:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YCWnt5jzrz4qDm; Tue, 17 Dec 2024 22:34:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734474866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FEYDISxlKbh+KqLiwSjwtxQ0QJRoKG+Re4MK6VvfQY8=; b=iuQgSaz6uxdlo/YI2j2oF5XiJ/36eG1ELZSYFd1ReOjl2ACg9pU2Zr7V+TKMWffkbjzNrl /j3ji6VIuC37wDczsyhndiNJnJ+2A40xZcCrADUGShEGJyBgdoUQF5h/ble56q4gEP9EcP 4NFluF1YFOTvfyez3lK11km1Jszcdhs0YIieGdZnd9P5CzmvMJ5VkEnqPu9Wh5ZCgkwa0D EQvXICJSJtjIktcEJD0vjLczYl4fvCiZAlS7Vi1oB308I9US7P6/9RU24n9sy4ZnBlNf2k XuFULoZBpKpSxv+tmFTre6zue6nudx+5lEGkedrKtww0vwgB1tgb5EWUCevCLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734474866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FEYDISxlKbh+KqLiwSjwtxQ0QJRoKG+Re4MK6VvfQY8=; b=R8qTWGpd+KonMOaz/eVeg1d4I1bSYEfMO3jNdRy6/i9TuvPmPelx6/3zifR1eQucTJc7zt 0R1qWkt8kZ+WfzkZ7WkSv+2ScLhElSxZUQvLzENuZjR4o1MMUgDL0EngB7BohHp/LJaVLg zl5WElEhAzPSSHWSwRHQuti0XAjKGxne26I/q2OqxdfoePHiMlasz7KJY3B01Zx+4TlGS2 26czBA862a4UCGr1aR6xU5nb/mf8Q3qDDy5j6U5woGLnEgLFhce3LgSouXIsoQQxbjZWTX lqzGe/z5ekv9Z9XtevHhRZdds9INb4lcdHpb+XbzJFf3WHKX3a4cxTTQv1bIGA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734474866; a=rsa-sha256; cv=none; b=SF0ZiUzoTQNJLylLmu7UmrANDtZ4+49v7C2KHJFb8M3tIS6tzDiYRP/+qnMiJgBNzs1tXO 9tQjlvkfBOEYqYDs/O/vjmVuJyZTNIkYYIx/tD6UXEBPWISQApnkDVud77jfGKnmAfssZP QvT+8Z8WWxFhgb2AWRpcrGRGtqblNOOEloBnS7MzYKnfrFb7rDtdfEmn2MeesgRZ3s+7mJ LDjcV7Q1JwrMO0Ilci3Qgw13h4TDwFFG/gvKsbg8tj6V3SEtqrVG94JjMw5sDMVxghpzqR GYLBSZ/oE2C40bqi1wcZH3p/X8WiqWfcF4RLXvQ1KU6idxkpCJovB+tkqqhpng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YCWnt5JrnzhsC; Tue, 17 Dec 2024 22:34:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BHMYQeI023517; Tue, 17 Dec 2024 22:34:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BHMYQsf023514; Tue, 17 Dec 2024 22:34:26 GMT (envelope-from git) Date: Tue, 17 Dec 2024 22:34:26 GMT Message-Id: <202412172234.4BHMYQsf023514@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: a2d78713171c - main - sed: The change ("c") command should start a new cycle. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: a2d78713171cf138b5ae50d61f82df1af7574c95 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=a2d78713171cf138b5ae50d61f82df1af7574c95 commit a2d78713171cf138b5ae50d61f82df1af7574c95 Author: Valeriy Ushakov AuthorDate: 2024-12-17 22:27:01 +0000 Commit: Warner Losh CommitDate: 2024-12-17 22:34:06 +0000 sed: The change ("c") command should start a new cycle. The "c" command should start the next cycle as clarified in POSIX 2024. This is also consistent with historical and gnu sed behavior. This patch is from OpenBSD by way of NetBSD with a tweak to the man page date by me. Confirmed the test case in the bug now works. PR: 271817 Obtained from: NetBSD (1.39 uwe), OpenBSD (1.39 millert) Sponsored by: Netflix --- usr.bin/sed/process.c | 2 +- usr.bin/sed/sed.1 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/sed/process.c b/usr.bin/sed/process.c index ddf9a976bc46..d06dc09542e1 100644 --- a/usr.bin/sed/process.c +++ b/usr.bin/sed/process.c @@ -134,7 +134,7 @@ redirect: psl = 0; if (cp->a2 == NULL || lastaddr || lastline()) (void)fprintf(outfile, "%s", cp->t); - break; + goto new; case 'd': pd = 1; goto new; diff --git a/usr.bin/sed/sed.1 b/usr.bin/sed/sed.1 index 02bfbf0e9f31..345f673310d8 100644 --- a/usr.bin/sed/sed.1 +++ b/usr.bin/sed/sed.1 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd April 8, 2021 +.Dd December 17, 2024 .Dt SED 1 .Os .Sh NAME @@ -372,7 +372,7 @@ If the label is not specified, branch to the end of the script. .Pp .It [2addr]c\e .It text -Delete the pattern space. +Delete the pattern space and start the next cycle. With 0 or 1 address or at the end of a 2-address range, .Em text is written to the standard output.