patch 8.2.4477: crash when using fuzzy completion
Problem: Crash when using fuzzy completion.
Solution: Temporary fix: put back regexp. (closes #9851)
diff --git a/src/cmdexpand.c b/src/cmdexpand.c
index 138ff9e..dd8bc06 100644
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -2370,7 +2370,7 @@
static int
ExpandOther(
char_u *pat,
- expand_T *xp,
+ expand_T *xp,
regmatch_T *rmp,
char_u ***matches,
int *numMatches)
@@ -2496,7 +2496,6 @@
int ret;
int flags;
char_u *tofree = NULL;
- int fuzzy = cmdline_fuzzy_complete(pat);
flags = map_wildopts_to_ewflags(options);
@@ -2581,15 +2580,12 @@
pat = tofree;
}
- if (!fuzzy)
- {
- regmatch.regprog = vim_regcomp(pat, magic_isset() ? RE_MAGIC : 0);
- if (regmatch.regprog == NULL)
- return FAIL;
+ regmatch.regprog = vim_regcomp(pat, magic_isset() ? RE_MAGIC : 0);
+ if (regmatch.regprog == NULL)
+ return FAIL;
- // set ignore-case according to p_ic, p_scs and pat
- regmatch.rm_ic = ignorecase(pat);
- }
+ // set ignore-case according to p_ic, p_scs and pat
+ regmatch.rm_ic = ignorecase(pat);
if (xp->xp_context == EXPAND_SETTINGS
|| xp->xp_context == EXPAND_BOOL_SETTINGS)
@@ -2603,8 +2599,7 @@
else
ret = ExpandOther(pat, xp, ®match, matches, numMatches);
- if (!fuzzy)
- vim_regfree(regmatch.regprog);
+ vim_regfree(regmatch.regprog);
vim_free(tofree);
return ret;