1
0
forked from aniani/vim

updated for version 7.3.406

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)
This commit is contained in:
Bram Moolenaar 2012-01-20 17:57:51 +01:00
parent 5af7d71276
commit 3ef7cdf0fd
2 changed files with 15 additions and 17 deletions

View File

@ -328,6 +328,10 @@ static LOGFONT norm_logfont;
static LRESULT _OnImeNotify(HWND hWnd, DWORD dwCommand, DWORD dwData); static LRESULT _OnImeNotify(HWND hWnd, DWORD dwCommand, DWORD dwData);
#endif #endif
#if defined(FEAT_MBYTE) && defined(WIN3264)
static char_u *convert_filter(char_u *s);
#endif
#ifdef DEBUG_PRINT_ERROR #ifdef DEBUG_PRINT_ERROR
/* /*
* Print out the last Windows error message * Print out the last Windows error message
@ -3275,28 +3279,20 @@ mch_set_mouse_shape(int shape)
# if defined(FEAT_MBYTE) && defined(WIN3264) # if defined(FEAT_MBYTE) && defined(WIN3264)
/* /*
* Wide version of convert_filter(). Keep in sync! * Wide version of convert_filter().
*/ */
static WCHAR * static WCHAR *
convert_filterW(char_u *s) convert_filterW(char_u *s)
{ {
WCHAR *res; char_u *tmp;
unsigned s_len = (unsigned)STRLEN(s); int len;
unsigned i;
res = (WCHAR *)alloc((s_len + 3) * sizeof(WCHAR)); tmp = convert_filter(s);
if (res != NULL) if (tmp == NULL)
{ return NULL;
for (i = 0; i < s_len; ++i) len = (int)STRLEN(s) + 3;
if (s[i] == '\t' || s[i] == '\n') res = enc_to_utf16(tmp, &len);
res[i] = '\0'; vim_free(tmp);
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;
}
return res; return res;
} }

View File

@ -714,6 +714,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
406,
/**/ /**/
405, 405,
/**/ /**/