summaryrefslogtreecommitdiff
path: root/src/vim9compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r--src/vim9compile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c
index cccf02c2c..f1a6a0311 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -2781,7 +2781,8 @@ compile_def_function(
cmd = ea.cmd;
if ((*cmd != '$' || starts_with_colon)
&& (starts_with_colon || !(*cmd == '\''
- || (cmd[0] == cmd[1] && (*cmd == '+' || *cmd == '-')))))
+ || (cmd[0] != NUL && cmd[0] == cmd[1]
+ && (*cmd == '+' || *cmd == '-')))))
{
ea.cmd = skip_range(ea.cmd, TRUE, NULL);
if (ea.cmd > cmd)