patch 9.1.1518: getcompletiontype() may crash
Problem: getcompletiontype() crashes when no completion is available
(after v9.1.1509).
Solution: Don't call set_expand_context() (zeertzjq)
fixes: #17681
closes: #17684
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/proto/ex_getln.pro b/src/proto/ex_getln.pro
index 9087c83..6c93ac7 100644
--- a/src/proto/ex_getln.pro
+++ b/src/proto/ex_getln.pro
@@ -30,7 +30,6 @@
void escape_fname(char_u **pp);
void tilde_replace(char_u *orig_pat, int num_files, char_u **files);
cmdline_info_T *get_cmdline_info(void);
-char_u *get_cmdline_completion(expand_T *xpc);
void f_getcmdcomplpat(typval_T *argvars, typval_T *rettv);
void f_getcmdcompltype(typval_T *argvars, typval_T *rettv);
void f_getcmdline(typval_T *argvars, typval_T *rettv);
diff --git a/src/proto/usercmd.pro b/src/proto/usercmd.pro
index d0cd2a3..dcf2a1d 100644
--- a/src/proto/usercmd.pro
+++ b/src/proto/usercmd.pro
@@ -9,7 +9,7 @@
char_u *get_user_cmd_flags(expand_T *xp, int idx);
char_u *get_user_cmd_nargs(expand_T *xp, int idx);
char_u *get_user_cmd_complete(expand_T *xp, int idx);
-char_u *cmdcomplete_type_to_str(int expand);
+char_u *cmdcomplete_type_to_str(int expand, char_u *arg);
int cmdcomplete_str_to_type(char_u *complete_str);
char *uc_fun_cmd(void);
int parse_compl_arg(char_u *value, int vallen, int *complp, long *argt, char_u **compl_arg);