tweaks: chuck a special case, and reduce the scope of two variables

A KEY_WINCH does not need to be separately treated since the basic
action for anything that is not recognized at the yes-no prompt is:
to continue.
master
Benno Schulenberg 2016-12-26 20:20:03 +01:00
parent 9973366685
commit 1fb820386b
1 changed files with 3 additions and 10 deletions

View File

@ -736,12 +736,9 @@ int do_yesno_prompt(bool all, const char *msg)
* that are accepted for the corresponding answer. Of each variable, * that are accepted for the corresponding answer. Of each variable,
* the first character is displayed in the help lines. */ * the first character is displayed in the help lines. */
do { while (response == -2) {
int kbinput; int kbinput;
functionptrtype func; functionptrtype func;
#ifndef DISABLE_MOUSE
int mouse_x, mouse_y;
#endif
if (!ISSET(NO_HELP)) { if (!ISSET(NO_HELP)) {
char shortstr[3]; char shortstr[3];
@ -787,17 +784,13 @@ int do_yesno_prompt(bool all, const char *msg)
currmenu = MYESNO; currmenu = MYESNO;
kbinput = get_kbinput(bottomwin); kbinput = get_kbinput(bottomwin);
#ifndef NANO_TINY
if (kbinput == KEY_WINCH)
continue;
#endif
func = func_from_key(&kbinput); func = func_from_key(&kbinput);
if (func == do_cancel) if (func == do_cancel)
response = -1; response = -1;
#ifndef DISABLE_MOUSE #ifndef DISABLE_MOUSE
else if (kbinput == KEY_MOUSE) { else if (kbinput == KEY_MOUSE) {
int mouse_x, mouse_y;
/* We can click on the Yes/No/All shortcuts to select an answer. */ /* We can click on the Yes/No/All shortcuts to select an answer. */
if (get_mouseinput(&mouse_x, &mouse_y, FALSE) == 0 && if (get_mouseinput(&mouse_x, &mouse_y, FALSE) == 0 &&
wmouse_trafo(bottomwin, &mouse_y, &mouse_x, FALSE) && wmouse_trafo(bottomwin, &mouse_y, &mouse_x, FALSE) &&
@ -827,7 +820,7 @@ int do_yesno_prompt(bool all, const char *msg)
else if (all && strchr(allstr, kbinput) != NULL) else if (all && strchr(allstr, kbinput) != NULL)
response = 2; response = 2;
} }
} while (response == -2); }
free(message); free(message);