Merge branch 'consolez'

This fixes an issue where the Git wrapper would terminate upon Ctrl+C,
even in the case when its child process would *not* terminate.

Note: while the original intention was to fix running Git Bash in
ConsoleZ, the bug fix applies also to running

	C:\Program Files\Git\bin\bash -l -i

in a cmd window.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2016-08-13 07:36:35 +02:00

View File

@@ -651,8 +651,16 @@ int main(void)
working_directory, /* use parent's */
&si, &pi);
if (br) {
if (wait)
if (wait) {
/*
* Ignore Ctrl+C: the called process needs
* to handle this event correctly, then we
* quit, too.
*/
SetConsoleCtrlHandler(NULL, TRUE);
WaitForSingleObject(pi.hProcess, INFINITE);
SetConsoleCtrlHandler(NULL, FALSE);
}
if (!GetExitCodeProcess(pi.hProcess, (DWORD *)&r))
print_error(L"error reading exit code",
GetLastError());