Projects
Mega:23.03
util-linux
_service:tar_scm:backport-vipw-flush-stdout-bef...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:backport-vipw-flush-stdout-before-getting-answer.patch of Package util-linux
From 56bacb552d017858751aac208987604f7c9387c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Nogueira?= <erico.erc@gmail.com> Date: Fri, 22 Oct 2021 14:28:50 -0300 Subject: [PATCH] vipw: flush stdout before getting answer. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 <erico.erc@gmail.com> --- login-utils/vipw.c | 1 + 1 file changed, 1 insertion(+) diff --git a/login-utils/vipw.c b/login-utils/vipw.c index f178c8f..bf76f51 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); -- 1.8.3.1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2