1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-11-11 20:05:07 -05:00

pacman/util.c: fix output flushing in questions

Flush stream before taking input in select_question() and only flush
once during question().  Also fix some tabs inside related fprintf
statements.

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Andrew Gregory 2013-05-04 09:39:28 -04:00 committed by Allan McRae
parent 0aa9628560
commit 34da9d25e4

View File

@ -1388,7 +1388,7 @@ int multiselect_question(char *array, int count)
fprintf(stream, "\n"); fprintf(stream, "\n");
fprintf(stream, _("Enter a selection (default=all)")); fprintf(stream, _("Enter a selection (default=all)"));
fprintf(stream, ": "); fprintf(stream, ": ");
fflush(stream); fflush(stream);
if(config->noconfirm) { if(config->noconfirm) {
@ -1452,7 +1452,8 @@ int select_question(int count)
while(1) { while(1) {
fprintf(stream, "\n"); fprintf(stream, "\n");
fprintf(stream, _("Enter a number (default=%d)"), preset); fprintf(stream, _("Enter a number (default=%d)"), preset);
fprintf(stream, ": "); fprintf(stream, ": ");
fflush(stream);
if(config->noconfirm) { if(config->noconfirm) {
fprintf(stream, "\n"); fprintf(stream, "\n");
@ -1513,7 +1514,6 @@ static int question(short preset, const char *format, va_list args)
return preset; return preset;
} }
fflush(stream);
flush_term_input(fd_in); flush_term_input(fd_in);
if(fgets(response, sizeof(response), stdin)) { if(fgets(response, sizeof(response), stdin)) {