nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 3a170d2c3e79c8c595d75732a37bf8e6ace2b87a
parent e8751d1d5c3e493cfb0c55e84d9a273a8fa5a5ac
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Tue, 18 Dec 2018 19:07:28 +0100

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.

Diffstat:
Msrc/rcfile.c | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 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);