From owner-dev-commits-src-all@freebsd.org Sat Sep 25 08:41:26 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CAB4467DC93; Sat, 25 Sep 2021 08:41: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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HGj6t4bG9z3lP6; Sat, 25 Sep 2021 08:41:26 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 7C94127398; Sat, 25 Sep 2021 08:41:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18P8fQ12017975; Sat, 25 Sep 2021 08:41:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18P8fQWN017974; Sat, 25 Sep 2021 08:41:26 GMT (envelope-from git) Date: Sat, 25 Sep 2021 08:41:26 GMT Message-Id: <202109250841.18P8fQWN017974@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Piotr Pawel Stefaniak Subject: git: 14fb8056ceef - stable/13 - sh: reset sh bindings on bind -e, bind -v MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: pstef X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 14fb8056ceef592c6f392f0f678dc45d11b7417e Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Sep 2021 08:41:26 -0000 The branch stable/13 has been updated by pstef: URL: https://cgit.FreeBSD.org/src/commit/?id=14fb8056ceef592c6f392f0f678dc45d11b7417e commit 14fb8056ceef592c6f392f0f678dc45d11b7417e Author: Piotr Pawel Stefaniak AuthorDate: 2021-09-19 20:17:01 +0000 Commit: Piotr Pawel Stefaniak CommitDate: 2021-09-25 08:34:38 +0000 sh: reset sh bindings on bind -e, bind -v Until this change, any bindings set in histedit() were lost on calls to bindcmd(). Only bind -e and bind -v call libedit's keymacro_reset(). Currently you cannot fool libedit/map.c:map_bind() by trying something like bind -le as when p[0] == '-', it does a switch statement on p[1]. (cherry picked from commit 9413dfd331e705a1d7909fe41f06a30e43c442f7) --- bin/sh/histedit.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bin/sh/histedit.c b/bin/sh/histedit.c index 488a0b355f80..7c366d252743 100644 --- a/bin/sh/histedit.c +++ b/bin/sh/histedit.c @@ -501,6 +501,13 @@ bindcmd(int argc, char **argv) fclose(out); + if (argc > 1 && argv[1][0] == '-' && + memchr("ve", argv[1][1], 2) != NULL) { + Vflag = argv[1][1] == 'v'; + Eflag = !Vflag; + histedit(); + } + INTON; return ret;