diff options
-rw-r--r-- | ProcessWin32.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ProcessWin32.c b/ProcessWin32.c index 12670762d9..8f01684a1a 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. */ |