Skip to content

Commit

Permalink
Merge pull request msysgit#98 from nalla/stdout-unbuffered
Browse files Browse the repository at this point in the history
mingw: explicitly `fflush` stdout
  • Loading branch information
dscho committed Apr 29, 2015
2 parents 8195392 + e9c2eb5 commit 36bd1d7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions builtin/clean.c
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ static int *list_and_choose(struct menu_opts *opts, struct menu_stuff *stuff)
clean_get_color(CLEAN_COLOR_RESET));
}

fflush(stdout);
if (strbuf_getline(&choice, stdin, '\n') != EOF) {
strbuf_trim(&choice);
} else {
Expand Down Expand Up @@ -658,6 +659,7 @@ static int filter_by_patterns_cmd(void)
clean_print_color(CLEAN_COLOR_PROMPT);
printf(_("Input ignore patterns>> "));
clean_print_color(CLEAN_COLOR_RESET);
fflush(stdout);
if (strbuf_getline(&confirm, stdin, '\n') != EOF)
strbuf_trim(&confirm);
else
Expand Down Expand Up @@ -755,6 +757,7 @@ static int ask_each_cmd(void)
if (!eof) {
qname = quote_path_relative(item->string, NULL, &buf);
printf(_("remove %s? "), qname);
fflush(stdout);
if (strbuf_getline(&confirm, stdin, '\n') != EOF) {
strbuf_trim(&confirm);
} else {
Expand Down

0 comments on commit 36bd1d7

Please sign in to comment.