3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.160
3ef2ca
Fcc: outbox
3ef2ca
From: Bram Moolenaar <Bram@moolenaar.net>
3ef2ca
Mime-Version: 1.0
3ef2ca
Content-Type: text/plain; charset=UTF-8
3ef2ca
Content-Transfer-Encoding: 8bit
3ef2ca
------------
3ef2ca
3ef2ca
Patch 7.4.160
3ef2ca
Problem:    Win32: Crash when executing external command.
3ef2ca
Solution:   Only close the handle when it was created. (Yasuhiro Matsumoto)
3ef2ca
Files:	    src/os_win32.c
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.159/src/os_win32.c	2014-01-12 13:24:46.000000000 +0100
3ef2ca
--- src/os_win32.c	2014-01-24 19:54:35.778219160 +0100
3ef2ca
***************
3ef2ca
*** 4627,4632 ****
3ef2ca
--- 4627,4633 ----
3ef2ca
  	    DWORD		flags = CREATE_NEW_CONSOLE;
3ef2ca
  	    char_u		*p;
3ef2ca
  
3ef2ca
+ 	    ZeroMemory(&si, sizeof(si));
3ef2ca
  	    si.cb = sizeof(si);
3ef2ca
  	    si.lpReserved = NULL;
3ef2ca
  	    si.lpDesktop = NULL;
3ef2ca
***************
3ef2ca
*** 4723,4731 ****
3ef2ca
  	    if (newcmd != cmdbase)
3ef2ca
  		vim_free(newcmd);
3ef2ca
  
3ef2ca
! 	    if (si.hStdInput != NULL)
3ef2ca
  	    {
3ef2ca
! 		/* Close the handle to \\.\NUL */
3ef2ca
  		CloseHandle(si.hStdInput);
3ef2ca
  	    }
3ef2ca
  	    /* Close the handles to the subprocess, so that it goes away */
3ef2ca
--- 4724,4732 ----
3ef2ca
  	    if (newcmd != cmdbase)
3ef2ca
  		vim_free(newcmd);
3ef2ca
  
3ef2ca
! 	    if (si.dwFlags == STARTF_USESTDHANDLES && si.hStdInput != NULL)
3ef2ca
  	    {
3ef2ca
! 		/* Close the handle to \\.\NUL created above. */
3ef2ca
  		CloseHandle(si.hStdInput);
3ef2ca
  	    }
3ef2ca
  	    /* Close the handles to the subprocess, so that it goes away */
3ef2ca
*** ../vim-7.4.159/src/version.c	2014-01-23 22:45:54.608127182 +0100
3ef2ca
--- src/version.c	2014-01-24 19:52:46.946216170 +0100
3ef2ca
***************
3ef2ca
*** 740,741 ****
3ef2ca
--- 740,743 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     160,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
hundred-and-one symptoms of being an internet addict:
3ef2ca
209. Your house stinks because you haven't cleaned it in a week.
3ef2ca
3ef2ca
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3ef2ca
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3ef2ca
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
3ef2ca
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///