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

master
Benno Schulenberg 2018-12-18 19:18:10 +01:00
parent 3a170d2c3e
commit 762cee242a
1 changed files with 7 additions and 7 deletions

View File

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