vim-patch:9.1.0313: Crash when using heredoc with comment in command block

Problem:  Crash when using heredoc with comment in command block.
Solution: Handle a newline more like the end of the line, fix coverity
          warning (zeertzjq).

closes: vim/vim#14535

1f5175d9af
This commit is contained in:
zeertzjq
2024-04-14 05:03:49 +08:00
parent 617a385142
commit e81fe387d6
3 changed files with 34 additions and 28 deletions

View File

@@ -1045,20 +1045,6 @@ char *skiptowhite(const char *p)
return (char *)p;
}
/// Skip over text until ' ' or '\t' or newline or NUL
///
/// @param[in] p Text to skip over.
///
/// @return Pointer to the next whitespace or newline or NUL character.
char *skiptowhite_or_nl(const char *p)
FUNC_ATTR_NONNULL_ALL FUNC_ATTR_PURE
{
while (*p != ' ' && *p != '\t' && *p != NL && *p != NUL) {
p++;
}
return (char *)p;
}
/// skiptowhite_esc: Like skiptowhite(), but also skip escaped chars
///
/// @param p