]> granicus.if.org Git - vim/commitdiff
patch 8.0.0991: using wrong character conversion for DBCS v8.0.0991
authorBram Moolenaar <Bram@vim.org>
Wed, 23 Aug 2017 21:36:25 +0000 (23:36 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 23 Aug 2017 21:36:25 +0000 (23:36 +0200)
Problem:    Using wrong character conversion for DBCS.
Solution:   Use utf_char2bytes instead of mb_char2bytes. (Yasuhiro Matsumoto,
            closes #2012)

src/terminal.c
src/version.c

index 7fadbb6939d685cc0f53f84a4d56c84c0dcd763b..67c065ceddbd8019b4aeb59436c5456744421050 100644 (file)
@@ -945,7 +945,7 @@ move_terminal_to_buffer(term_T *term)
                        width = 1;
                        vim_memset(p + pos.col, 0, sizeof(cellattr_T));
                        if (ga_grow(&ga, 1) == OK)
-                           ga.ga_len += mb_char2bytes(' ',
+                           ga.ga_len += utf_char2bytes(' ',
                                             (char_u *)ga.ga_data + ga.ga_len);
                    }
                    else
@@ -1943,7 +1943,7 @@ handle_pushline(int cols, const VTermScreenCell *cells, void *user)
                    break;
                }
                for (i = 0; (c = cells[col].chars[i]) > 0 || i == 0; ++i)
-                   ga.ga_len += mb_char2bytes(c == NUL ? ' ' : c,
+                   ga.ga_len += utf_char2bytes(c == NUL ? ' ' : c,
                                             (char_u *)ga.ga_data + ga.ga_len);
                p[col].width = cells[col].width;
                p[col].attrs = cells[col].attrs;
index 9dc93f2d61b2753ca15efb404a0258bafa543610..a0ce86d80d5c171bee9dfd21b3a46d04b997095b 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    991,
 /**/
     990,
 /**/