563e593
To: vim-dev@vim.org
563e593
Subject: Patch 7.2.089 (extra)
563e593
Fcc: outbox
563e593
From: Bram Moolenaar <Bram@moolenaar.net>
563e593
Mime-Version: 1.0
563e593
Content-Type: text/plain; charset=ISO-8859-1
563e593
Content-Transfer-Encoding: 8bit
563e593
------------
563e593
563e593
Patch 7.2.089 (extra)
563e593
Problem:    Win32: crash when using Ultramon buttons.
563e593
Solution:   Don't use a WM_OLE message of zero size. (Ray Megal)
563e593
Files:	    src/if_ole.cpp, src/gui_w48.c
563e593
563e593
563e593
*** ../vim-7.2.088/src/if_ole.cpp	Sun Mar 16 14:53:11 2008
563e593
--- src/if_ole.cpp	Mon Jan 19 21:16:33 2009
563e593
***************
563e593
*** 353,361 ****
563e593
      }
563e593
  
563e593
      /* Pass the string to the main input loop. The memory will be freed when
563e593
!      * the message is processed.
563e593
       */
563e593
!     PostMessage(NULL, WM_OLE, 0, (LPARAM)str);
563e593
  
563e593
      return S_OK;
563e593
  }
563e593
--- 353,365 ----
563e593
      }
563e593
  
563e593
      /* Pass the string to the main input loop. The memory will be freed when
563e593
!      * the message is processed.  Except for an empty message, we don't need
563e593
!      * to post it then.
563e593
       */
563e593
!     if (*str == NUL)
563e593
! 	vim_free(str);
563e593
!     else
563e593
! 	PostMessage(NULL, WM_OLE, 0, (LPARAM)str);
563e593
  
563e593
      return S_OK;
563e593
  }
563e593
*** ../vim-7.2.088/src/gui_w48.c	Wed Dec 24 12:20:10 2008
563e593
--- src/gui_w48.c	Mon Jan 19 21:19:30 2009
563e593
***************
563e593
*** 1663,1670 ****
563e593
      if (msg.message == WM_OLE)
563e593
      {
563e593
  	char_u *str = (char_u *)msg.lParam;
563e593
! 	add_to_input_buf(str, (int)STRLEN(str));
563e593
! 	vim_free(str);
563e593
  	return;
563e593
      }
563e593
  #endif
563e593
--- 1663,1679 ----
563e593
      if (msg.message == WM_OLE)
563e593
      {
563e593
  	char_u *str = (char_u *)msg.lParam;
563e593
! 	if (str == NULL || *str == NUL)
563e593
! 	{
563e593
! 	    /* Message can't be ours, forward it.  Fixes problem with Ultramon
563e593
! 	     * 3.0.4 */
563e593
! 	    DispatchMessage(&msg;;
563e593
! 	}
563e593
! 	else
563e593
! 	{
563e593
! 	    add_to_input_buf(str, (int)STRLEN(str));
563e593
! 	    vim_free(str);  /* was allocated in CVim::SendKeys() */
563e593
! 	}
563e593
  	return;
563e593
      }
563e593
  #endif
563e593
*** ../vim-7.2.088/src/version.c	Thu Jan 22 21:49:21 2009
563e593
--- src/version.c	Wed Jan 28 14:16:01 2009
563e593
***************
563e593
*** 678,679 ****
563e593
--- 678,681 ----
563e593
  {   /* Add new patch number below this line */
563e593
+ /**/
563e593
+     89,
563e593
  /**/
563e593
563e593
563e593
-- 
563e593
How To Keep A Healthy Level Of Insanity:
563e593
16. Have your coworkers address you by your wrestling name, Rock Hard Kim.
563e593
563e593
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
563e593
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
563e593
\\\        download, build and distribute -- http://www.A-A-P.org        ///
563e593
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///