Karsten Hopp 1c2954
To: vim_dev@googlegroups.com
Karsten Hopp 1c2954
Subject: Patch 7.3.406
Karsten Hopp 1c2954
Fcc: outbox
Karsten Hopp 1c2954
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 1c2954
Mime-Version: 1.0
Karsten Hopp 1c2954
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 1c2954
Content-Transfer-Encoding: 8bit
Karsten Hopp 1c2954
------------
Karsten Hopp 1c2954
Karsten Hopp 1c2954
Patch 7.3.406
Karsten Hopp 1c2954
Problem:    Multi-byte characters in b:browsefilter are not handled correctly.
Karsten Hopp 1c2954
Solution:   First use convert_filter() normally and then convert to wide
Karsten Hopp 1c2954
	    characters. (Taro Muraoka)
Karsten Hopp 1c2954
Files:	    src/gui_w48.c
Karsten Hopp 1c2954
Karsten Hopp 1c2954
Karsten Hopp 1c2954
*** ../vim-7.3.405/src/gui_w48.c	2011-09-07 18:58:24.000000000 +0200
Karsten Hopp 1c2954
--- src/gui_w48.c	2012-01-20 17:54:19.000000000 +0100
Karsten Hopp 1c2954
***************
Karsten Hopp 1c2954
*** 328,333 ****
Karsten Hopp 1c2954
--- 328,337 ----
Karsten Hopp 1c2954
  static LRESULT _OnImeNotify(HWND hWnd, DWORD dwCommand, DWORD dwData);
Karsten Hopp 1c2954
  #endif
Karsten Hopp 1c2954
  
Karsten Hopp 1c2954
+ #if defined(FEAT_MBYTE) && defined(WIN3264)
Karsten Hopp 1c2954
+ static char_u *convert_filter(char_u *s);
Karsten Hopp 1c2954
+ #endif
Karsten Hopp 1c2954
+ 
Karsten Hopp 1c2954
  #ifdef DEBUG_PRINT_ERROR
Karsten Hopp 1c2954
  /*
Karsten Hopp 1c2954
   * Print out the last Windows error message
Karsten Hopp 1c2954
***************
Karsten Hopp 1c2954
*** 3275,3302 ****
Karsten Hopp 1c2954
  
Karsten Hopp 1c2954
  # if defined(FEAT_MBYTE) && defined(WIN3264)
Karsten Hopp 1c2954
  /*
Karsten Hopp 1c2954
!  * Wide version of convert_filter().  Keep in sync!
Karsten Hopp 1c2954
   */
Karsten Hopp 1c2954
      static WCHAR *
Karsten Hopp 1c2954
  convert_filterW(char_u *s)
Karsten Hopp 1c2954
  {
Karsten Hopp 1c2954
!     WCHAR	*res;
Karsten Hopp 1c2954
!     unsigned	s_len = (unsigned)STRLEN(s);
Karsten Hopp 1c2954
!     unsigned	i;
Karsten Hopp 1c2954
  
Karsten Hopp 1c2954
!     res = (WCHAR *)alloc((s_len + 3) * sizeof(WCHAR));
Karsten Hopp 1c2954
!     if (res != NULL)
Karsten Hopp 1c2954
!     {
Karsten Hopp 1c2954
! 	for (i = 0; i < s_len; ++i)
Karsten Hopp 1c2954
! 	    if (s[i] == '\t' || s[i] == '\n')
Karsten Hopp 1c2954
! 		res[i] = '\0';
Karsten Hopp 1c2954
! 	    else
Karsten Hopp 1c2954
! 		res[i] = s[i];
Karsten Hopp 1c2954
! 	res[s_len] = NUL;
Karsten Hopp 1c2954
! 	/* Add two extra NULs to make sure it's properly terminated. */
Karsten Hopp 1c2954
! 	res[s_len + 1] = NUL;
Karsten Hopp 1c2954
! 	res[s_len + 2] = NUL;
Karsten Hopp 1c2954
!     }
Karsten Hopp 1c2954
      return res;
Karsten Hopp 1c2954
  }
Karsten Hopp 1c2954
  
Karsten Hopp 1c2954
--- 3279,3298 ----
Karsten Hopp 1c2954
  
Karsten Hopp 1c2954
  # if defined(FEAT_MBYTE) && defined(WIN3264)
Karsten Hopp 1c2954
  /*
Karsten Hopp 1c2954
!  * Wide version of convert_filter().
Karsten Hopp 1c2954
   */
Karsten Hopp 1c2954
      static WCHAR *
Karsten Hopp 1c2954
  convert_filterW(char_u *s)
Karsten Hopp 1c2954
  {
Karsten Hopp 1c2954
!     char_u *tmp;
Karsten Hopp 1c2954
!     int len;
Karsten Hopp 1c2954
  
Karsten Hopp 1c2954
!     tmp = convert_filter(s);
Karsten Hopp 1c2954
!     if (tmp == NULL)
Karsten Hopp 1c2954
! 	return NULL;
Karsten Hopp 1c2954
!     len = (int)STRLEN(s) + 3;
Karsten Hopp 1c2954
!     res = enc_to_utf16(tmp, &len;;
Karsten Hopp 1c2954
!     vim_free(tmp);
Karsten Hopp 1c2954
      return res;
Karsten Hopp 1c2954
  }
Karsten Hopp 1c2954
  
Karsten Hopp 1c2954
*** ../vim-7.3.405/src/version.c	2012-01-20 17:15:47.000000000 +0100
Karsten Hopp 1c2954
--- src/version.c	2012-01-20 17:57:09.000000000 +0100
Karsten Hopp 1c2954
***************
Karsten Hopp 1c2954
*** 716,717 ****
Karsten Hopp 1c2954
--- 716,719 ----
Karsten Hopp 1c2954
  {   /* Add new patch number below this line */
Karsten Hopp 1c2954
+ /**/
Karsten Hopp 1c2954
+     406,
Karsten Hopp 1c2954
  /**/
Karsten Hopp 1c2954
Karsten Hopp 1c2954
-- 
Karsten Hopp 1c2954
DENNIS: Look,  strange women lying on their backs in ponds handing out
Karsten Hopp 1c2954
        swords ... that's no basis for a system of government.  Supreme
Karsten Hopp 1c2954
        executive power derives from a mandate from the masses, not from some
Karsten Hopp 1c2954
        farcical aquatic ceremony.
Karsten Hopp 1c2954
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
Karsten Hopp 1c2954
Karsten Hopp 1c2954
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 1c2954
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 1c2954
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 1c2954
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///