summaryrefslogtreecommitdiffstats
path: root/src/userfunc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/userfunc.c')
-rw-r--r--src/userfunc.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/userfunc.c b/src/userfunc.c
index 015733cdb1..71b39837c7 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -1230,18 +1230,15 @@ get_function_body(
int save_sc_version = current_sctx.sc_version;
int var_count = 0;
int semicolon = 0;
- char_u *argend;
current_sctx.sc_version
= vim9_function ? SCRIPT_VERSION_VIM9 : 1;
- argend = skip_var_list(arg, TRUE, &var_count, &semicolon,
+ arg = skip_var_list(arg, TRUE, &var_count, &semicolon,
TRUE);
- if (argend == NULL)
- // Invalid list assignment: skip to closing bracket.
- argend = find_name_end(arg, NULL, NULL, FNE_INCL_BR);
- arg = skipwhite(argend);
+ if (arg != NULL)
+ arg = skipwhite(arg);
current_sctx.sc_version = save_sc_version;
- if (arg[0] == '=' && arg[1] == '<' && arg[2] =='<')
+ if (arg != NULL && STRNCMP(arg, "=<<", 3) == 0)
{
p = skipwhite(arg + 3);
while (TRUE)