]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.406 v7.3.406
authorBram Moolenaar <Bram@vim.org>
Fri, 20 Jan 2012 16:57:51 +0000 (17:57 +0100)
committerBram Moolenaar <Bram@vim.org>
Fri, 20 Jan 2012 16:57:51 +0000 (17:57 +0100)
Problem:    Multi-byte characters in b:browsefilter are not handled correctly.
Solution:   First use convert_filter() normally and then convert to wide
            characters. (Taro Muraoka)

src/gui_w48.c
src/version.c

index a6a8184a7c6b9e4e0d78378da2bfdf22aaf99ada..80fad9e8f5bdbbfb1f35aac4359c6446107db527 100644 (file)
@@ -328,6 +328,10 @@ static LOGFONT norm_logfont;
 static LRESULT _OnImeNotify(HWND hWnd, DWORD dwCommand, DWORD dwData);
 #endif
 
+#if defined(FEAT_MBYTE) && defined(WIN3264)
+static char_u *convert_filter(char_u *s);
+#endif
+
 #ifdef DEBUG_PRINT_ERROR
 /*
  * Print out the last Windows error message
@@ -3275,28 +3279,20 @@ mch_set_mouse_shape(int shape)
 
 # if defined(FEAT_MBYTE) && defined(WIN3264)
 /*
- * Wide version of convert_filter().  Keep in sync!
+ * Wide version of convert_filter().
  */
     static WCHAR *
 convert_filterW(char_u *s)
 {
-    WCHAR      *res;
-    unsigned   s_len = (unsigned)STRLEN(s);
-    unsigned   i;
+    char_u *tmp;
+    int len;
 
-    res = (WCHAR *)alloc((s_len + 3) * sizeof(WCHAR));
-    if (res != NULL)
-    {
-       for (i = 0; i < s_len; ++i)
-           if (s[i] == '\t' || s[i] == '\n')
-               res[i] = '\0';
-           else
-               res[i] = s[i];
-       res[s_len] = NUL;
-       /* Add two extra NULs to make sure it's properly terminated. */
-       res[s_len + 1] = NUL;
-       res[s_len + 2] = NUL;
-    }
+    tmp = convert_filter(s);
+    if (tmp == NULL)
+       return NULL;
+    len = (int)STRLEN(s) + 3;
+    res = enc_to_utf16(tmp, &len);
+    vim_free(tmp);
     return res;
 }
 
index 73bb3abf921657dad660c325982fa6c324d8c67a..0b281a5de91beb1f5fce0441659cab4bc402e38f 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    406,
 /**/
     405,
 /**/