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 <dvornik+git@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
bert Dvornik
2010-04-25 21:22:31 -04:00
committed by Johannes Schindelin
parent 12a5a33704
commit c5ba0d9fa2

View File

@@ -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) {