0
0
mirror of https://github.com/vim/vim.git synced 2025-08-24 19:45:50 -04:00

updated for version 7.4.160

Problem:    Win32: Crash when executing external command.
Solution:   Only close the handle when it was created. (Yasuhiro Matsumoto)
This commit is contained in:
Bram Moolenaar 2014-01-24 19:55:37 +01:00
parent 361aa50547
commit fcc3f46735
2 changed files with 5 additions and 2 deletions

View File

@ -4627,6 +4627,7 @@ mch_call_shell(
DWORD flags = CREATE_NEW_CONSOLE; DWORD flags = CREATE_NEW_CONSOLE;
char_u *p; char_u *p;
ZeroMemory(&si, sizeof(si));
si.cb = sizeof(si); si.cb = sizeof(si);
si.lpReserved = NULL; si.lpReserved = NULL;
si.lpDesktop = NULL; si.lpDesktop = NULL;
@ -4723,9 +4724,9 @@ mch_call_shell(
if (newcmd != cmdbase) if (newcmd != cmdbase)
vim_free(newcmd); vim_free(newcmd);
if (si.hStdInput != NULL) if (si.dwFlags == STARTF_USESTDHANDLES && si.hStdInput != NULL)
{ {
/* Close the handle to \\.\NUL */ /* Close the handle to \\.\NUL created above. */
CloseHandle(si.hStdInput); CloseHandle(si.hStdInput);
} }
/* Close the handles to the subprocess, so that it goes away */ /* Close the handles to the subprocess, so that it goes away */

View File

@ -738,6 +738,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
160,
/**/ /**/
159, 159,
/**/ /**/