# HG changeset patch # User Bram Moolenaar # Date 1390589737 -3600 # Node ID f29febf858be9c7df896cc86ea89c3da8823b4fb # Parent 89b3a7ef9622de8d820463e867ea39e38d193d2d updated for version 7.4.160 Problem: Win32: Crash when executing external command. Solution: Only close the handle when it was created. (Yasuhiro Matsumoto) diff --git a/src/os_win32.c b/src/os_win32.c --- a/src/os_win32.c +++ b/src/os_win32.c @@ -4627,6 +4627,7 @@ mch_call_shell( DWORD flags = CREATE_NEW_CONSOLE; char_u *p; + ZeroMemory(&si, sizeof(si)); si.cb = sizeof(si); si.lpReserved = NULL; si.lpDesktop = NULL; @@ -4723,9 +4724,9 @@ mch_call_shell( if (newcmd != cmdbase) 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); } /* Close the handles to the subprocess, so that it goes away */ diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -739,6 +739,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 160, +/**/ 159, /**/ 158,