]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
chsh: fflush stdout before reading from stdin
authorLorenzo Beretta <vc.net.loreb@gmail.com>
Mon, 25 Oct 2021 13:28:02 +0000 (15:28 +0200)
committerLorenzo Beretta <vc.net.loreb@gmail.com>
Mon, 25 Oct 2021 13:28:02 +0000 (15:28 +0200)
Same problem as described in https://github.com/karelzak/util-linux/pull/1481

Signed-off-by: Lorenzo Beretta <vc.net.loreb@gmail.com>
login-utils/chsh.c

index 3497120725decc969dd721ae83b503a0c4aaf068..3b446beeb64eec9cc53cf86b2ab086fe1db66638 100644 (file)
@@ -210,6 +210,7 @@ static char *ask_new_shell(char *question, char *oldshell)
        if ((ans = readline(" ")) == NULL)
 #else
        putchar(' ');
+       fflush(stdout);
        if (getline(&ans, &dummy, stdin) < 0)
 #endif
                return NULL;