Simplify get_input()

This commit is contained in:
Arun Prakash Jana 2020-05-31 20:10:11 +05:30
parent 984cffecc4
commit 4a2d978630
No known key found for this signature in database
GPG Key ID: A75979F35C080412
1 changed files with 8 additions and 8 deletions

View File

@ -822,22 +822,22 @@ static inline bool xconfirm(int c)
static int get_input(const char *prompt) static int get_input(const char *prompt)
{ {
int r;
if (prompt) if (prompt)
printmsg(prompt); printmsg(prompt);
cleartimeout(); cleartimeout();
int r = getch();
#ifdef KEY_RESIZE #ifdef KEY_RESIZE
do { while (r == KEY_RESIZE) {
r = getch(); if (prompt) {
if (r == KEY_RESIZE && prompt) {
clearoldprompt(); clearoldprompt();
xlines = LINES; xlines = LINES;
printmsg(prompt); printmsg(prompt);
} }
} while (r == KEY_RESIZE);
#else r = getch();
r = getch(); }
#endif #endif
settimeout(); settimeout();
return r; return r;