tabs ==> spaces

This commit is contained in:
bumbread 2022-06-09 20:09:01 +11:00
parent 470bce6c6d
commit 5890659112
1 changed files with 12 additions and 12 deletions

View File

@ -97,29 +97,29 @@ int system(const char* string) {
MultiByteToWideChar(65001 /* UTF8 */, 0, string, -1, cmd_line + sizeof("cmd.exe ") - 1, wchars_required); MultiByteToWideChar(65001 /* UTF8 */, 0, string, -1, cmd_line + sizeof("cmd.exe ") - 1, wchars_required);
STARTUPINFOW si = { STARTUPINFOW si = {
.cb = sizeof(STARTUPINFOW), .cb = sizeof(STARTUPINFOW),
.dwFlags = STARTF_USESTDHANDLES, .dwFlags = STARTF_USESTDHANDLES,
.hStdInput = GetStdHandle(STD_INPUT_HANDLE), .hStdInput = GetStdHandle(STD_INPUT_HANDLE),
.hStdError = GetStdHandle(STD_ERROR_HANDLE), .hStdError = GetStdHandle(STD_ERROR_HANDLE),
.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE) .hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE)
}; };
PROCESS_INFORMATION pi = {}; PROCESS_INFORMATION pi = {};
if (!CreateProcessW(NULL, cmd_line, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) { if (!CreateProcessW(NULL, cmd_line, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) {
goto error; goto error;
} }
// Wait until child process exits. // Wait until child process exits.
WaitForSingleObject(pi.hProcess, INFINITE); WaitForSingleObject(pi.hProcess, INFINITE);
DWORD exit_code; DWORD exit_code;
if (!GetExitCodeProcess(pi.hProcess, &exit_code)) { if (!GetExitCodeProcess(pi.hProcess, &exit_code)) {
goto error; goto error;
} }
// Close process and thread handles. // Close process and thread handles.
CloseHandle(pi.hProcess); CloseHandle(pi.hProcess);
CloseHandle(pi.hThread); CloseHandle(pi.hThread);
free(cmd_line); free(cmd_line);
return exit_code; return exit_code;