patch 8.2.1755: Vim9: crash when using invalid heredoc marker
Problem: Vim9: crash when using invalid heredoc marker. (Dhiraj Mishra)
Solution: Check for NULL list. (closes #7027) Fix comment character.
diff --git a/src/evalvars.c b/src/evalvars.c
index 3571169..9aa6d65 100644
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -558,6 +558,7 @@
int text_indent_len = 0;
char_u *text_indent = NULL;
char_u dot[] = ".";
+ int comment_char = in_vim9script() ? '#' : '"';
if (eap->getline == NULL)
{
@@ -585,11 +586,11 @@
}
// The marker is the next word.
- if (*cmd != NUL && *cmd != '"')
+ if (*cmd != NUL && *cmd != comment_char)
{
marker = skipwhite(cmd);
p = skiptowhite(marker);
- if (*skipwhite(p) != NUL && *skipwhite(p) != '"')
+ if (*skipwhite(p) != NUL && *skipwhite(p) != comment_char)
{
semsg(_(e_trailing_arg), p);
return NULL;