summaryrefslogtreecommitdiffstats
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index fbf2c7d0dd..4aaccb593f 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -2881,7 +2881,9 @@ parse_command_modifiers(
case 'f': // only accept ":filter {pat} cmd"
{
- char_u *reg_pat;
+ char_u *reg_pat;
+ char_u *nulp = NULL;
+ int c = 0;
if (!checkforcmd_noparen(&p, "filter", 4)
|| *p == NUL || ends_excmd(*p))
@@ -2902,7 +2904,8 @@ parse_command_modifiers(
p = skip_vimgrep_pat(p, NULL, NULL);
else
// NOTE: This puts a NUL after the pattern.
- p = skip_vimgrep_pat(p, &reg_pat, NULL);
+ p = skip_vimgrep_pat_ext(p, &reg_pat, NULL,
+ &nulp, &c);
if (p == NULL || *p == NUL)
break;
if (!skip_only)
@@ -2911,6 +2914,9 @@ parse_command_modifiers(
vim_regcomp(reg_pat, RE_MAGIC);
if (cmod->cmod_filter_regmatch.regprog == NULL)
break;
+ // restore the character overwritten by NUL
+ if (nulp != NULL)
+ *nulp = c;
}
eap->cmd = p;
continue;