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.
This commit is contained in:
Benno Schulenberg 2018-12-18 19:07:28 +01:00
parent e8751d1d5c
commit 3a170d2c3e

View File

@ -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);