summaryrefslogtreecommitdiffstats
path: root/src/userfunc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/userfunc.c')
-rw-r--r--src/userfunc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/userfunc.c b/src/userfunc.c
index 1d96a358a8..39d8fb25be 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -2374,6 +2374,7 @@ trans_function_name(
int extra = 0;
lval_T lv;
int vim9script;
+ static char *e_function_name = N_("E129: Function name required");
if (fdp != NULL)
CLEAR_POINTER(fdp);
@@ -2401,7 +2402,7 @@ trans_function_name(
if (end == start)
{
if (!skip)
- emsg(_("E129: Function name required"));
+ emsg(_(e_function_name));
goto theend;
}
if (end == NULL || (lv.ll_tv != NULL && (lead > 2 || lv.ll_range)))
@@ -2517,6 +2518,12 @@ trans_function_name(
}
len = (int)(end - lv.ll_name);
}
+ if (len <= 0)
+ {
+ if (!skip)
+ emsg(_(e_function_name));
+ goto theend;
+ }
// In Vim9 script a user function is script-local by default.
vim9script = ASCII_ISUPPER(*start) && in_vim9script();