tweaks: adjust the indentation after the previous change

Also reshuffle two declarations and improve two comments.
master
Benno Schulenberg 2018-10-24 18:12:06 +02:00
parent 0ad0dcc926
commit 2516b64046
1 changed files with 39 additions and 41 deletions

View File

@ -344,7 +344,8 @@ void parse_binding(char *ptr, bool dobind)
{ {
char *keyptr = NULL, *keycopy = NULL, *funcptr = NULL, *menuptr = NULL; char *keyptr = NULL, *keycopy = NULL, *funcptr = NULL, *menuptr = NULL;
sc *s, *newsc = NULL; sc *s, *newsc = NULL;
int menu; int menu, mask = 0;
subnfunc *f;
if (*ptr == '\0') { if (*ptr == '\0') {
rcfile_error(N_("Missing key name")); rcfile_error(N_("Missing key name"));
@ -429,10 +430,10 @@ void parse_binding(char *ptr, bool dobind)
goto free_things; goto free_things;
} }
/* When unbinding, wipe the given shortcut from the given menu. */
if (!dobind) { if (!dobind) {
/* Find and wipe the given shortcut from the given menu. */
for (s = sclist; s != NULL; s = s->next) for (s = sclist; s != NULL; s = s->next)
if ((s->menus & menu) && !strcmp(s->keystr, keycopy)) if ((s->menus & menu) && strcmp(s->keystr, keycopy) == 0)
s->menus &= ~menu; s->menus &= ~menu;
free_things: free_things:
@ -441,9 +442,6 @@ void parse_binding(char *ptr, bool dobind)
return; return;
} }
subnfunc *f;
int mask = 0;
/* 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)
if (f->func == newsc->func) if (f->func == newsc->func)
@ -479,7 +477,7 @@ void parse_binding(char *ptr, bool dobind)
} }
#ifndef NANO_TINY #ifndef NANO_TINY
/* If this is a toggle, copy its sequence number. */ /* If this is a toggle, find and copy its sequence number. */
if (newsc->func == do_toggle_void) { if (newsc->func == do_toggle_void) {
for (s = sclist; s != NULL; s = s->next) for (s = sclist; s != NULL; s = s->next)
if (s->func == do_toggle_void && s->toggle == newsc->toggle) if (s->func == do_toggle_void && s->toggle == newsc->toggle)