Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion compat/win32/git-wrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
#include <stdio.h>
#include <wchar.h>

/*
Control Handler Function
All events are disabled!
*/
BOOL WINAPI CtrlHandler( DWORD fdwCtrlType )
{
return TRUE;
}

static WCHAR msystem_bin[64];

static void print_error(LPCWSTR prefix, DWORD error_number)
Expand Down Expand Up @@ -547,8 +556,11 @@ int main(void)
working_directory, /* use parent's */
&si, &pi);
if (br) {
if (wait)
if (wait) {
/* The only way to exit this program is the launched command end. */
SetConsoleCtrlHandler(CtrlHandler, TRUE);
WaitForSingleObject(pi.hProcess, INFINITE);
}
if (!GetExitCodeProcess(pi.hProcess, (DWORD *)&r))
print_error(L"error reading exit code",
GetLastError());
Expand Down