From 4faaa079e3b464643bc90802381119685f5a586d Mon Sep 17 00:00:00 2001 From: KWSys Upstream Date: Mon, 25 Jan 2021 10:05:14 -0500 Subject: KWSys 2021-01-25 (10e36d47) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Code extracted from: https://gitlab.kitware.com/utils/kwsys.git at commit 10e36d47415840a0318331733460183152a0feb9 (master). Upstream Shortlog ----------------- Martin Storsjö (1): fca5ad3a Process: Fix execute error handling re working dir on windows --- ProcessWin32.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ProcessWin32.c b/ProcessWin32.c index 1267076..8f01684 100644 --- a/ProcessWin32.c +++ b/ProcessWin32.c @@ -962,7 +962,10 @@ void kwsysProcess_Execute(kwsysProcess* cp) kwsysProcessCleanup(cp, GetLastError()); return; } - SetCurrentDirectoryW(cp->WorkingDirectory); + if (!SetCurrentDirectoryW(cp->WorkingDirectory)) { + kwsysProcessCleanup(cp, GetLastError()); + return; + } } /* Setup the stdin pipe for the first process. */ -- cgit v0.12