comparison src/os_win32.c @ 5627:f29febf858be v7.4.160

updated for version 7.4.160 Problem: Win32: Crash when executing external command. Solution: Only close the handle when it was created. (Yasuhiro Matsumoto)
author Bram Moolenaar <bram@vim.org>
date Fri, 24 Jan 2014 19:55:37 +0100
parents 735b70faac4a
children 7db84aadd37a
comparison
equal deleted inserted replaced
5626:89b3a7ef9622 5627:f29febf858be
4625 STARTUPINFO si; 4625 STARTUPINFO si;
4626 PROCESS_INFORMATION pi; 4626 PROCESS_INFORMATION pi;
4627 DWORD flags = CREATE_NEW_CONSOLE; 4627 DWORD flags = CREATE_NEW_CONSOLE;
4628 char_u *p; 4628 char_u *p;
4629 4629
4630 ZeroMemory(&si, sizeof(si));
4630 si.cb = sizeof(si); 4631 si.cb = sizeof(si);
4631 si.lpReserved = NULL; 4632 si.lpReserved = NULL;
4632 si.lpDesktop = NULL; 4633 si.lpDesktop = NULL;
4633 si.lpTitle = NULL; 4634 si.lpTitle = NULL;
4634 si.dwFlags = 0; 4635 si.dwFlags = 0;
4721 } 4722 }
4722 4723
4723 if (newcmd != cmdbase) 4724 if (newcmd != cmdbase)
4724 vim_free(newcmd); 4725 vim_free(newcmd);
4725 4726
4726 if (si.hStdInput != NULL) 4727 if (si.dwFlags == STARTF_USESTDHANDLES && si.hStdInput != NULL)
4727 { 4728 {
4728 /* Close the handle to \\.\NUL */ 4729 /* Close the handle to \\.\NUL created above. */
4729 CloseHandle(si.hStdInput); 4730 CloseHandle(si.hStdInput);
4730 } 4731 }
4731 /* Close the handles to the subprocess, so that it goes away */ 4732 /* Close the handles to the subprocess, so that it goes away */
4732 CloseHandle(pi.hThread); 4733 CloseHandle(pi.hThread);
4733 CloseHandle(pi.hProcess); 4734 CloseHandle(pi.hProcess);