From 62cab47a8a7059aae506c63334d195d4040c690f Mon Sep 17 00:00:00 2001 From: bert Dvornik Date: Sun, 25 Apr 2010 21:22:31 -0400 Subject: [PATCH] mingw: Don't ask the user yes/no questions if they can't see the question. If the stdout of the command is connected to a terminal but the stderr has been redirected, the odds are good that the user can't see any question we print out to stderr. This will result in a "mysterious hang" while the app is waiting for user input. It seems better to be conservative, and avoid asking for input whenever the stderr is not a terminal, just like we do for stdin. Signed-off-by: bert Dvornik Signed-off-by: Johannes Schindelin --- compat/mingw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compat/mingw.c b/compat/mingw.c index 4fe094f676..3b8107372f 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -175,7 +175,7 @@ static int ask_user_yes_no(const char *format, ...) return !run_command_v_opt(retry_hook, 0); } - if (!isatty(_fileno(stdin))) + if (!isatty(_fileno(stdin)) || !isatty(_fileno(stderr))) return 0; while (1) { -- 2.11.4.GIT