From 777651ab552f4573c3eb62e79b1bdf914279e821 Mon Sep 17 00:00:00 2001 From: pfg Date: Fri, 4 Jan 2013 04:03:21 +0000 Subject: [PATCH] MFC r244941: libedit: bind the correct command when using "bind -k". "ed-argument-digit" (i. e. command 0) was incorrectly used instead. This bug comes from the original sources imported in 1994 and has been confirmed in upstream NetBSD. Reported by: Yamagi Burmeister Submitted by: Christoph Mallon git-svn-id: svn://svn.freebsd.org/base/stable/9@245025 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- lib/libedit/map.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libedit/map.c b/lib/libedit/map.c index 591118f2c..c70904aa2 100644 --- a/lib/libedit/map.c +++ b/lib/libedit/map.c @@ -1250,7 +1250,7 @@ map_bind(EditLine *el, int argc, const char **argv) char inbuf[EL_BUFSIZ]; char outbuf[EL_BUFSIZ]; const char *in = NULL; - char *out = NULL; + char *out; el_bindings_t *bp, *ep; int cmd; int key; @@ -1368,7 +1368,7 @@ map_bind(EditLine *el, int argc, const char **argv) return (-1); } if (key) - term_set_arrow(el, in, key_map_str(el, out), ntype); + term_set_arrow(el, in, key_map_cmd(el, cmd), ntype); else { if (in[1]) { key_add(el, in, key_map_cmd(el, cmd), ntype); -- 2.45.0