summaryrefslogtreecommitdiff
path: root/src/cmdexpand.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-07-25 14:11:55 +0200
committerBram Moolenaar <Bram@vim.org>2020-07-25 14:11:55 +0200
commitc841afff6a89592f23710c6da5b0fea89b240937 (patch)
treea91b6b153e09b3fcf83f5540d15a326c3357ed38 /src/cmdexpand.c
parent13e12b8a3c0fec29017f2dbdc6f57e372f8a7efd (diff)
downloadvim-git-c841afff6a89592f23710c6da5b0fea89b240937.tar.gz
patch 8.2.1289: crash when using a custom completion functionv8.2.1289
Problem: Crash when using a custom completion function. Solution: Initialize all of the expand_T. (closes #6532)
Diffstat (limited to 'src/cmdexpand.c')
-rw-r--r--src/cmdexpand.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/src/cmdexpand.c b/src/cmdexpand.c
index a10fff8b3..fe82ab7d4 100644
--- a/src/cmdexpand.c
+++ b/src/cmdexpand.c
@@ -494,18 +494,9 @@ ExpandOne(
void
ExpandInit(expand_T *xp)
{
- xp->xp_pattern = NULL;
- xp->xp_pattern_len = 0;
+ CLEAR_POINTER(xp);
xp->xp_backslash = XP_BS_NONE;
-#ifndef BACKSLASH_IN_FILENAME
- xp->xp_shell = FALSE;
-#endif
xp->xp_numfiles = -1;
- xp->xp_files = NULL;
-#if defined(FEAT_EVAL)
- xp->xp_arg = NULL;
-#endif
- xp->xp_line = NULL;
}
/*
@@ -2425,7 +2416,7 @@ expand_shellcmd(
# if defined(FEAT_EVAL)
/*
* Call "user_expand_func()" to invoke a user defined Vim script function and
- * return the result (either a string or a List).
+ * return the result (either a string, a List or NULL).
*/
static void *
call_user_expand_func(