To: vim-dev@vim.org Subject: Patch 6.1.307 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.307 Problem: When a double-byte character has an illegal tail byte the display is messed up. (Yasuhiro Matsumoto) Solution: Draw "XX" instead of the wrong character. Files: src/screen.c *** ../vim61.306/src/screen.c Sun Jan 19 19:58:24 2003 --- src/screen.c Tue Jan 21 19:51:03 2003 *************** *** 3263,3275 **** mb_l = 1; else if (mb_l > 1) { ! if (ptr[1] != NUL) mb_c = (c << 8) + ptr[1]; else { ! /* head byte at end of line */ ! mb_l = 1; ! transchar_nonprint(extra, c); p_extra = extra; n_extra = (int)STRLEN(extra) - 1; c_extra = NUL; --- 3264,3288 ---- mb_l = 1; else if (mb_l > 1) { ! /* We assume a second byte below 32 is illegal. ! * Hopefully this is OK for all double-byte encodings! ! */ ! if (ptr[1] < 32) mb_c = (c << 8) + ptr[1]; else { ! if (ptr[1] == NUL) ! { ! /* head byte at end of line */ ! mb_l = 1; ! transchar_nonprint(extra, c); ! } ! else ! { ! /* illegal tail byte */ ! mb_l = 2; ! STRCPY(extra, "XX"); ! } p_extra = extra; n_extra = (int)STRLEN(extra) - 1; c_extra = NUL; *** ../vim61.306/src/version.c Tue Jan 28 21:47:16 2003 --- src/version.c Tue Jan 28 21:48:45 2003 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 307, /**/ -- hundred-and-one symptoms of being an internet addict: 68. Your cat always puts viruses on your dogs homepage /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///