summaryrefslogtreecommitdiffstats
path: root/curs_lib.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1998-10-21 16:07:41 +0000
committerThomas Roessler <roessler@does-not-exist.org>1998-10-21 16:07:41 +0000
commit7a4a4d019584e9bfed994041dccdca34629f7df1 (patch)
treec8d71cd020b18427b017e1cde1d551394937482a /curs_lib.c
parentbc58c2650de751a2e1eecf6e6a326cc9a6a34d78 (diff)
Also accept numbers as input in mutt_multi_choice(). From Byrial.
Diffstat (limited to 'curs_lib.c')
-rw-r--r--curs_lib.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/curs_lib.c b/curs_lib.c
index 113a6ef9..6b20d68f 100644
--- a/curs_lib.c
+++ b/curs_lib.c
@@ -382,25 +382,36 @@ void mutt_curs_set (int cursor)
int mutt_multi_choice (char *prompt, char *letters)
{
event_t ch;
- int choice = 0;
+ int choice;
char *p;
mvaddstr (LINES - 1, 0, prompt);
clrtoeol ();
- while (!choice)
+ FOREVER
{
mutt_refresh ();
ch = mutt_getch ();
if (ch.ch == -1)
+ {
choice = -1;
+ break;
+ }
else
{
p = strchr (letters, ch.ch);
if (p)
+ {
choice = p - letters + 1;
- else
- BEEP ();
+ break;
+ }
+ else if (ch.ch <= '9' && ch.ch > '0')
+ {
+ choice = ch.ch - '0';
+ if (choice <= strlen (letters))
+ break;
+ }
}
+ BEEP ();
}
CLEARLINE (LINES - 1);
mutt_refresh ();