From: Arun Prakash Jana Date: Thu, 24 Oct 2019 03:17:45 +0000 (+0530) Subject: Fix KEY_RESIZE loop X-Git-Tag: v2.8~126 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=5734f49126f4da49d5f27fc27b1ca34bb13697bd;p=nnn.git Fix KEY_RESIZE loop --- diff --git a/src/nnn.c b/src/nnn.c index 9b9b6dad..70c945e0 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -588,22 +588,20 @@ static void printprompt(const char *str) static int get_input(const char *prompt) { - int r; + int r = KEY_RESIZE; if (prompt) printprompt(prompt); cleartimeout(); #ifdef KEY_RESIZE - do { + while (r == KEY_RESIZE) { r = getch(); - if (r == KEY_RESIZE) { - if (prompt) { - clearoldprompt(); - xlines = LINES; - printprompt(prompt); - } + if (r == KEY_RESIZE && prompt) { + clearoldprompt(); + xlines = LINES; + printprompt(prompt); } - } while (r == KEY_RESIZE); + }; #else r = getch(); #endif