]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.419 v7.3.419
authorBram Moolenaar <Bram@vim.org>
Thu, 26 Jan 2012 19:41:26 +0000 (20:41 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 26 Jan 2012 19:41:26 +0000 (20:41 +0100)
Problem:    DBCS encoding in a user command does not always work.
Solution:   Skip over DBCS characters. (Yasuhiro Matsumoto)

src/ex_docmd.c
src/version.c

index 270d00c2738e53d927976237e6bf1b610842b315..83bf50c4b18769e0052aa39e51c6083a733256e0 100644 (file)
@@ -5967,7 +5967,14 @@ uc_check_code(code, len, buf, cmd, eap, split_buf, split_len)
            result = STRLEN(eap->arg) + 2;
            for (p = eap->arg; *p; ++p)
            {
-               if (*p == '\\' || *p == '"')
+#ifdef  FEAT_MBYTE
+               if (enc_dbcs != 0 && (*mb_ptr2len)(p) == 2)
+                   /* DBCS can contain \ in a trail byte, skip the
+                    * double-byte character. */
+                   ++p;
+               else
+#endif
+                    if (*p == '\\' || *p == '"')
                    ++result;
            }
 
@@ -5976,7 +5983,14 @@ uc_check_code(code, len, buf, cmd, eap, split_buf, split_len)
                *buf++ = '"';
                for (p = eap->arg; *p; ++p)
                {
-                   if (*p == '\\' || *p == '"')
+#ifdef  FEAT_MBYTE
+                   if (enc_dbcs != 0 && (*mb_ptr2len)(p) == 2)
+                       /* DBCS can contain \ in a trail byte, copy the
+                        * double-byte character to avoid escaping. */
+                       *buf++ = *p++;
+                   else
+#endif
+                        if (*p == '\\' || *p == '"')
                        *buf++ = '\\';
                    *buf++ = *p;
                }
index 8dadac45066ac1ac6b5116a83a97b28efd10ed1e..8f5052b5d97075d6f8a0c2603993cdd276be8884 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    419,
 /**/
     418,
 /**/