forked from aniani/vim
updated for version 7.3.419
Problem: DBCS encoding in a user command does not always work. Solution: Skip over DBCS characters. (Yasuhiro Matsumoto)
This commit is contained in:
@@ -5967,6 +5967,13 @@ uc_check_code(code, len, buf, cmd, eap, split_buf, split_len)
|
|||||||
result = STRLEN(eap->arg) + 2;
|
result = STRLEN(eap->arg) + 2;
|
||||||
for (p = eap->arg; *p; ++p)
|
for (p = eap->arg; *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 == '"')
|
if (*p == '\\' || *p == '"')
|
||||||
++result;
|
++result;
|
||||||
}
|
}
|
||||||
@@ -5976,6 +5983,13 @@ uc_check_code(code, len, buf, cmd, eap, split_buf, split_len)
|
|||||||
*buf++ = '"';
|
*buf++ = '"';
|
||||||
for (p = eap->arg; *p; ++p)
|
for (p = eap->arg; *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 == '"')
|
if (*p == '\\' || *p == '"')
|
||||||
*buf++ = '\\';
|
*buf++ = '\\';
|
||||||
*buf++ = *p;
|
*buf++ = *p;
|
||||||
|
@@ -714,6 +714,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
419,
|
||||||
/**/
|
/**/
|
||||||
418,
|
418,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user