]> Sergey Matveev's repositories - nnn.git/commitdiff
Use do-while instead of while
authorArun Prakash Jana <engineerarun@gmail.com>
Thu, 16 Jan 2020 17:39:19 +0000 (23:09 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Thu, 16 Jan 2020 17:39:19 +0000 (23:09 +0530)
src/nnn.c

index 63b6c03a637fc8dbda5805d0596bfa40495a1644..cec4b7c5723bcfa0b2ba80dd8fd5831756284847 100644 (file)
--- 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