diff options
author | Bram Moolenaar <Bram@vim.org> | 2012-01-26 20:41:26 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2012-01-26 20:41:26 +0100 |
commit | 7d550fbde5e1a9f40258b842a63be6007c3bd515 (patch) | |
tree | 5f037374df08e7943d540c28317976f10ea560b4 | |
parent | 6110a006d5b46b850247ed2c85bb7d7614cba025 (diff) |
updated for version 7.3.419v7.3.419
Problem: DBCS encoding in a user command does not always work.
Solution: Skip over DBCS characters. (Yasuhiro Matsumoto)
-rw-r--r-- | src/ex_docmd.c | 18 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 18 insertions, 2 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 270d00c273..83bf50c4b1 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -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; } diff --git a/src/version.c b/src/version.c index 8dadac4506..8f5052b5d9 100644 --- a/src/version.c +++ b/src/version.c @@ -715,6 +715,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 419, +/**/ 418, /**/ 417, |