diff options
author | Bram Moolenaar <Bram@vim.org> | 2012-01-20 17:57:51 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2012-01-20 17:57:51 +0100 |
commit | 3ef7cdf0fd040e7247bd395b51b107df0da081ef (patch) | |
tree | 5e8bfb63d0389b63298a00cab540a7a8163c6283 /src/gui_w48.c | |
parent | 5af7d712763904e2018efb0485c520cd12935d54 (diff) | |
download | vim-git-3ef7cdf0fd040e7247bd395b51b107df0da081ef.tar.gz |
updated for version 7.3.406v7.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)
Diffstat (limited to 'src/gui_w48.c')
-rw-r--r-- | src/gui_w48.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/src/gui_w48.c b/src/gui_w48.c index a6a8184a7..80fad9e8f 100644 --- a/src/gui_w48.c +++ b/src/gui_w48.c @@ -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; } |