mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-22 04:41:21 +03:00
Renaming a variable for clarity.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5620 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
parent
e5fee7e649
commit
e853c1ee7c
@ -7,6 +7,7 @@
|
|||||||
* doc/syntax/c.nanorc: Use a character class instead of a literal tab
|
* doc/syntax/c.nanorc: Use a character class instead of a literal tab
|
||||||
and space. The change was inspired by David Niklas.
|
and space. The change was inspired by David Niklas.
|
||||||
* src/prompt.c (do_yesno_prompt): Normalize the indentation.
|
* src/prompt.c (do_yesno_prompt): Normalize the indentation.
|
||||||
|
* src/prompt.c (do_yesno_prompt): Rename a variable.
|
||||||
|
|
||||||
2016-02-06 Benno Schulenberg <bensberg@justemail.net>
|
2016-02-06 Benno Schulenberg <bensberg@justemail.net>
|
||||||
* src/files.c (write_file): Remove the --nofollow option that hasn't
|
* src/files.c (write_file): Remove the --nofollow option that hasn't
|
||||||
|
20
src/prompt.c
20
src/prompt.c
@ -830,7 +830,7 @@ int do_prompt(bool allow_tabs,
|
|||||||
* TRUE when passed in), and -1 for Cancel. */
|
* TRUE when passed in), and -1 for Cancel. */
|
||||||
int do_yesno_prompt(bool all, const char *msg)
|
int do_yesno_prompt(bool all, const char *msg)
|
||||||
{
|
{
|
||||||
int ok = -2, width = 16;
|
int response = -2, width = 16;
|
||||||
const char *yesstr; /* String of Yes characters accepted. */
|
const char *yesstr; /* String of Yes characters accepted. */
|
||||||
const char *nostr; /* Same for No. */
|
const char *nostr; /* Same for No. */
|
||||||
const char *allstr; /* And All, surprise! */
|
const char *allstr; /* And All, surprise! */
|
||||||
@ -910,7 +910,7 @@ int do_yesno_prompt(bool all, const char *msg)
|
|||||||
func = func_from_key(&kbinput);
|
func = func_from_key(&kbinput);
|
||||||
|
|
||||||
if (func == do_cancel)
|
if (func == do_cancel)
|
||||||
ok = -1;
|
response = -1;
|
||||||
#ifndef DISABLE_MOUSE
|
#ifndef DISABLE_MOUSE
|
||||||
else if (kbinput == KEY_MOUSE) {
|
else if (kbinput == KEY_MOUSE) {
|
||||||
/* 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. */
|
||||||
@ -926,10 +926,10 @@ int do_yesno_prompt(bool all, const char *msg)
|
|||||||
|
|
||||||
/* x == 0 means they clicked Yes or No.
|
/* x == 0 means they clicked Yes or No.
|
||||||
* y == 0 means Yes or All. */
|
* y == 0 means Yes or All. */
|
||||||
ok = -2 * x * y + x - y + 1;
|
response = -2 * x * y + x - y + 1;
|
||||||
|
|
||||||
if (ok == 2 && !all)
|
if (response == 2 && !all)
|
||||||
ok = -2;
|
response = -2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* !DISABLE_MOUSE */
|
#endif /* !DISABLE_MOUSE */
|
||||||
@ -939,14 +939,14 @@ int do_yesno_prompt(bool all, const char *msg)
|
|||||||
} else {
|
} else {
|
||||||
/* Look for the kbinput in the Yes, No (and All) strings. */
|
/* Look for the kbinput in the Yes, No (and All) strings. */
|
||||||
if (strchr(yesstr, kbinput) != NULL)
|
if (strchr(yesstr, kbinput) != NULL)
|
||||||
ok = 1;
|
response = 1;
|
||||||
else if (strchr(nostr, kbinput) != NULL)
|
else if (strchr(nostr, kbinput) != NULL)
|
||||||
ok = 0;
|
response = 0;
|
||||||
else if (all && strchr(allstr, kbinput) != NULL)
|
else if (all && strchr(allstr, kbinput) != NULL)
|
||||||
ok = 2;
|
response = 2;
|
||||||
}
|
}
|
||||||
} while (ok == -2);
|
} while (response == -2);
|
||||||
|
|
||||||
currmenu = oldmenu;
|
currmenu = oldmenu;
|
||||||
return ok;
|
return response;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user