summaryrefslogtreecommitdiffstats
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2007-03-08 17:12:08 +0000
committerBram Moolenaar <Bram@vim.org>2007-03-08 17:12:08 +0000
commit552f8a1140a69491259cd8e4b7f1273be176c48f (patch)
tree25f5910530465fe538d6918d4b01256ae037ff9b /src/ex_docmd.c
parent6417da604d684e4af5622dae3f295f36cd815f81 (diff)
updated for version 7.0-214v7.0.214
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 7f136f19a7..1152a18a73 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -5551,6 +5551,9 @@ ex_delcommand(eap)
mch_memmove(cmd, cmd + 1, (gap->ga_len - i) * sizeof(ucmd_T));
}
+/*
+ * split and quote args for <f-args>
+ */
static char_u *
uc_split_args(arg, lenp)
char_u *arg;
@@ -5567,7 +5570,12 @@ uc_split_args(arg, lenp)
while (*p)
{
- if (p[0] == '\\' && vim_iswhite(p[1]))
+ if (p[0] == '\\' && p[1] == '\\')
+ {
+ len += 2;
+ p += 2;
+ }
+ else if (p[0] == '\\' && vim_iswhite(p[1]))
{
len += 1;
p += 2;
@@ -5603,7 +5611,13 @@ uc_split_args(arg, lenp)
*q++ = '"';
while (*p)
{
- if (p[0] == '\\' && vim_iswhite(p[1]))
+ if (p[0] == '\\' && p[1] == '\\')
+ {
+ *q++ = '\\';
+ *q++ = '\\';
+ p += 2;
+ }
+ else if (p[0] == '\\' && vim_iswhite(p[1]))
{
*q++ = p[1];
p += 2;
@@ -5735,7 +5749,7 @@ uc_check_code(code, len, buf, cmd, eap, split_buf, split_len)
}
break;
- case 2: /* Quote and split */
+ case 2: /* Quote and split (<f-args>) */
/* This is hard, so only do it once, and cache the result */
if (*split_buf == NULL)
*split_buf = uc_split_args(eap->arg, split_len);