diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1998-10-21 16:07:41 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1998-10-21 16:07:41 +0000 |
commit | 7a4a4d019584e9bfed994041dccdca34629f7df1 (patch) | |
tree | c8d71cd020b18427b017e1cde1d551394937482a /curs_lib.c | |
parent | bc58c2650de751a2e1eecf6e6a326cc9a6a34d78 (diff) |
Also accept numbers as input in mutt_multi_choice(). From Byrial.
Diffstat (limited to 'curs_lib.c')
-rw-r--r-- | curs_lib.c | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -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 (); |