From 3a170d2c3e79c8c595d75732a37bf8e6ace2b87a Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Tue, 18 Dec 2018 19:07:28 +0100 Subject: [PATCH] rcfile: when rebound, DO unbind a keystroke from its earlier function When not unbinding it from its earlier function (in the same menu), it would result in showing the keystroke twice in the help text. This fixes https://savannah.gnu.org/bugs/?55239. Bug was introduced a month ago, by commit f81d174f. --- src/rcfile.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/rcfile.c b/src/rcfile.c index fe6c90f7..39f77be0 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -428,12 +428,12 @@ void parse_binding(char *ptr, bool dobind) goto free_things; } - /* When unbinding, wipe the given shortcut from the given menu. */ - if (!dobind) { - for (s = sclist; s != NULL; s = s->next) - if ((s->menus & menu) && strcmp(s->keystr, keycopy) == 0) - s->menus &= ~menu; + /* Wipe the given shortcut from the given menu. */ + for (s = sclist; s != NULL; s = s->next) + if ((s->menus & menu) && strcmp(s->keystr, keycopy) == 0) + s->menus &= ~menu; + if (!dobind) { free_things: free(newsc); free(keycopy);