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.
master
Benno Schulenberg 2018-12-18 19:07:28 +01:00
parent e8751d1d5c
commit 3a170d2c3e
1 changed files with 5 additions and 5 deletions

View File

@ -428,12 +428,12 @@ void parse_binding(char *ptr, bool dobind)
goto free_things; goto free_things;
} }
/* When unbinding, wipe the given shortcut from the given menu. */ /* Wipe the given shortcut from the given menu. */
if (!dobind) { for (s = sclist; s != NULL; s = s->next)
for (s = sclist; s != NULL; s = s->next) if ((s->menus & menu) && strcmp(s->keystr, keycopy) == 0)
if ((s->menus & menu) && strcmp(s->keystr, keycopy) == 0) s->menus &= ~menu;
s->menus &= ~menu;
if (!dobind) {
free_things: free_things:
free(newsc); free(newsc);
free(keycopy); free(keycopy);