summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ProcessWin32.c5
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. */