nano

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

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

tweaks: reshuffle a bit of code, to have the exit point near the end

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

diff --git a/src/rcfile.c b/src/rcfile.c @@ -433,12 +433,9 @@ void parse_binding(char *ptr, bool dobind) if ((s->menus & menu) && strcmp(s->keystr, keycopy) == 0) s->menus &= ~menu; - if (!dobind) { - free_things: - free(newsc); - free(keycopy); - return; - } + /* When unbinding, we are done now. */ + if (!dobind) + goto free_things; /* Tally up the menus where the function exists. */ for (f = allfuncs; f != NULL; f = f->next) @@ -471,7 +468,10 @@ void parse_binding(char *ptr, bool dobind) /* Do not allow rebinding a frequent escape-sequence starter: Esc [. */ if (newsc->meta && newsc->keycode == 91) { rcfile_error(N_("Sorry, keystroke \"%s\" may not be rebound"), newsc->keystr); - goto free_things; + free_things: + free(keycopy); + free(newsc); + return; } #ifndef NANO_TINY