From: Lorenzo Beretta Date: Mon, 25 Oct 2021 13:28:02 +0000 (+0200) Subject: chsh: fflush stdout before reading from stdin X-Git-Tag: v2.38-rc1~197 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0a08200bd5664d1849e477f7f776ab4d13bb8422;p=thirdparty%2Futil-linux.git chsh: fflush stdout before reading from stdin Same problem as described in https://github.com/karelzak/util-linux/pull/1481 Signed-off-by: Lorenzo Beretta --- diff --git a/login-utils/chsh.c b/login-utils/chsh.c index 3497120725..3b446beeb6 100644 --- a/login-utils/chsh.c +++ b/login-utils/chsh.c @@ -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;