Syntax for executing shell commands
This commit is contained in:
@@ -84,6 +84,12 @@ bool AreEqual(String16 a, String16 b, unsigned ignore_case = false) {
|
||||
inline bool operator==(String16 a, String16 b) { return AreEqual(a, b); }
|
||||
inline bool operator!=(String16 a, String16 b) { return !AreEqual(a, b); }
|
||||
|
||||
wchar_t GetChar(String16 string, int64_t i) {
|
||||
wchar_t result = 0;
|
||||
if (i < string.len) result = string.data[i];
|
||||
return result;
|
||||
}
|
||||
|
||||
String16 Merge(Allocator allocator, Array<String16> list, String16 separator = " ") {
|
||||
int64_t char_count = 0;
|
||||
For(list) char_count += it.len;
|
||||
|
||||
@@ -367,8 +367,11 @@ Process CreateCommandLineProcess(String command_line, String working_dir) {
|
||||
String16 cmd = ToString16(scratch, command_line);
|
||||
void *env = NULL;
|
||||
|
||||
DWORD dwCreationFlags = 0;
|
||||
BOOL bInheritHandles = TRUE;
|
||||
|
||||
PROCESS_INFORMATION info = {};
|
||||
if (!CreateProcessW(L"c:\\windows\\system32\\cmd.exe", cmd.data, 0, 0, TRUE, 0, env, cwd.data, &startup, &info)) {
|
||||
if (!CreateProcessW(L"c:\\windows\\system32\\cmd.exe", cmd.data, 0, 0, bInheritHandles, dwCreationFlags, env, cwd.data, &startup, &info)) {
|
||||
Win32ProcessError(&process, "failed to create process", command_line);
|
||||
return process;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user