git: 14fb8056ceef - stable/13 - sh: reset sh bindings on bind -e, bind -v
Piotr Pawel Stefaniak
pstef at FreeBSD.org
Sat Sep 25 08:41:27 UTC 2021
The branch stable/13 has been updated by pstef:
URL: https://cgit.FreeBSD.org/src/commit/?id=14fb8056ceef592c6f392f0f678dc45d11b7417e
commit 14fb8056ceef592c6f392f0f678dc45d11b7417e
Author: Piotr Pawel Stefaniak <pstef at FreeBSD.org>
AuthorDate: 2021-09-19 20:17:01 +0000
Commit: Piotr Pawel Stefaniak <pstef at FreeBSD.org>
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;
More information about the dev-commits-src-branches
mailing list