vim-patch:8.1.1723: heredoc assignment has no room for new features

Problem:    Heredoc assignment has no room for new features. (FUJIWARA Takuya)
Solution:   Require the marker does not start with a lower case character.
            (closes vim/vim#4705)
2458200729
This commit is contained in:
Jurica Bradaric
2019-10-12 23:47:00 +02:00
parent fcc24d0df3
commit 3b894b1cb1
3 changed files with 34 additions and 16 deletions

View File

@@ -1548,7 +1548,7 @@ heredoc_get(exarg_T *eap, char_u *cmd)
text_indent_len = -1;
}
// The marker is the next word. Default marker is "."
// The marker is the next word.
if (*cmd != NUL && *cmd != '"') {
marker = skipwhite(cmd);
p = skiptowhite(marker);
@@ -1557,8 +1557,13 @@ heredoc_get(exarg_T *eap, char_u *cmd)
return NULL;
}
*p = NUL;
if (islower(*marker)) {
EMSG(_("E221: Marker cannot start with lower case letter"));
return NULL;
}
} else {
marker = (char_u *)".";
EMSG(_("E172: Missing marker"));
return NULL;
}
list_T *l = tv_list_alloc(0);