For PR351:
Implement the new environment pointer for ExecuteAndWait
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18928 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/System/Win32/Program.inc b/lib/System/Win32/Program.inc
index d6bd86a..4aff5e9 100644
--- a/lib/System/Win32/Program.inc
+++ b/lib/System/Win32/Program.inc
@@ -69,7 +69,8 @@
//
int
Program::ExecuteAndWait(const Path& path,
- const std::vector<std::string>& args) {
+ const std::vector<std::string>& args,
+ const char** env) {
if (!path.executable())
throw path.toString() + " is not executable";
@@ -124,8 +125,9 @@
PROCESS_INFORMATION pi;
memset(&pi, 0, sizeof(pi));
+ LPVOID lpEnvironment = envp;
if (!CreateProcess(path.c_str(), command, NULL, NULL, FALSE, 0,
- NULL, NULL, &si, &pi))
+ lpEnvironment, NULL, &si, &pi))
{
ThrowError(std::string("Couldn't execute program '") +
path.toString() + "'");