> Well, that's the other way around, using a backslash as the second byte.
> I think we should handle that when the first byte is found, thus
> skipping over both the bytes.  I thought the patch looks at the
> backslash.  Or does the backslash actually need escaping?  Then another
> location might also need to be changed.

This patch skip tail byte of multibyte. When '\' or '"' is found, it will be
escaped with backslash. When lead byte of multibyte is found, it should be
copied and be skipped tail byte of the multibute.
Then, this patch is possible to be written like following also.

diff -r 0dabc2ce136c src/ex_docmd.c
--- a/src/ex_docmd.c Tue Jan 10 22:31:32 2012 +0100
+++ b/src/ex_docmd.c Wed Jan 18 11:26:33 2012 +0900
@@ -5967,6 +5967,11 @@
     result = STRLEN(eap->arg) + 2;
     for (p = eap->arg; *p; ++p)
     {
+#ifdef  FEAT_MBYTE
+ if (enc_dbcs != 0 && (*mb_ptr2len)(p) > 1)
+    ++p;
+ else
+#endif
  if (*p == '\\' || *p == '"')
     ++result;
     }
@@ -5976,6 +5981,11 @@
  *buf++ = '"';
  for (p = eap->arg; *p; ++p)
  {
+#ifdef  FEAT_MBYTE
+    if (enc_dbcs != 0 && (*mb_ptr2len)(p) > 1)
+ *buf++ = *p++;
+    else
+#endif
     if (*p == '\\' || *p == '"')
  *buf++ = '\\';
     *buf++ = *p;

-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui