To: vim-dev@vim.org Subject: Patch 6.2.054 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2.054 Problem: A double-byte character with a second byte that is a backslash causes problems inside a string. Solution: Skip over multi-byte characters in a string properly. (Yasuhiro Matsumoto) Files: src/eval.c *** ../vim-6.2.053/src/eval.c Sun Jul 27 14:26:54 2003 --- src/eval.c Sat Jul 26 18:35:19 2003 *************** *** 2468,2473 **** --- 2468,2474 ---- * Find the end of the string, skipping backslashed characters. */ for (p = *arg + 1; *p && *p != '"'; ++p) + { if (*p == '\\' && p[1] != NUL) { ++p; *************** *** 2476,2481 **** --- 2477,2488 ---- if (*p == '<') extra += 2; } + #ifdef FEAT_MBYTE + if (has_mbyte) + p += (*mb_ptr2len_check)(p) - 1; + #endif + } + if (*p != '"') { EMSG2(_("E114: Missing quote: %s"), *arg); *************** *** 2581,2586 **** --- 2588,2604 ---- } else name[i++] = *p; + + #ifdef FEAT_MBYTE + /* For a multi-byte character copy the bytes after the first one. */ + if (has_mbyte) + { + int l = (*mb_ptr2len_check)(p); + + while (--l > 0) + name[i++] = *++p; + } + #endif } name[i] = NUL; *arg = p + 1; *** ../vim-6.2.053/src/version.c Sun Jul 27 14:59:28 2003 --- src/version.c Sun Jul 27 15:00:47 2003 *************** *** 632,633 **** --- 632,635 ---- { /* Add new patch number below this line */ + /**/ + 54, /**/ -- ALL: A witch! A witch! WITCH: It's a fair cop. ALL: Burn her! Burn her! Let's make her into a ladder. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// 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 here: http://ICCF-Holland.org/click1.html ///