From e1c01d08f19ca9848f80d9dbb9e44381c82dc6fa Mon Sep 17 00:00:00 2001 From: "Pedro F. Giffuni" Date: Tue, 1 Jan 2013 19:20:51 +0000 Subject: [PATCH] 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 MFC after: 3 days --- 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 591118f2cf02..c70904aa2d41 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);