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