From: Arun Prakash Jana Date: Thu, 16 Jan 2020 17:39:19 +0000 (+0530) Subject: Use do-while instead of while X-Git-Tag: v3.0~78 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=feec63ebb382b7e92dc6d4a2b767f89dc1ab4c7b;p=nnn.git Use do-while instead of while --- diff --git a/src/nnn.c b/src/nnn.c index 63b6c03a..cec4b7c5 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -712,20 +712,20 @@ static void printinfoln(const char *str) static int get_input(const char *prompt) { - int r = KEY_RESIZE; + int r; if (prompt) printprompt(prompt); cleartimeout(); #ifdef KEY_RESIZE - while (r == KEY_RESIZE) { + do { r = getch(); if (r == KEY_RESIZE && prompt) { clearoldprompt(); xlines = LINES; printprompt(prompt); } - }; + } while (r == KEY_RESIZE); #else r = getch(); #endif