From: Érico Nogueira Date: Fri, 22 Oct 2021 17:28:50 +0000 (-0300) Subject: vipw: flush stdout before getting answer. X-Git-Tag: v2.38-rc1~205^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=34a9b65587a7d704db0344e859511af4a6756c89;p=thirdparty%2Futil-linux.git vipw: flush stdout before getting answer. Otherwise the question is displayed only after the user presses Return, and the program looks like it's hanging. This happens at least on musl libc. Reported by @loreb. Signed-off-by: Érico Nogueira --- diff --git a/login-utils/vipw.c b/login-utils/vipw.c index 8e63efde28..f59948a443 100644 --- a/login-utils/vipw.c +++ b/login-utils/vipw.c @@ -353,6 +353,7 @@ int main(int argc, char *argv[]) * which means they can be translated. */ printf(_("Would you like to edit %s now [y/n]? "), orig_file); + fflush(stdout); if (fgets(response, sizeof(response), stdin) && rpmatch(response) == RPMATCH_YES) edit_file(1);