add special case for heredocs in utils::split_words() to avoid segfaults

This commit is contained in:
Axel Kohlmeyer
2021-08-04 12:03:34 -04:00
parent 7068f3e77b
commit c4442206d4

View File

@ -855,6 +855,13 @@ std::vector<std::string> utils::split_words(const std::string &text)
if (c != '\'') ++len;
c = *++buf;
// handle triple double quotation marks
} else if ((c == '"') && (buf[1] == '"') && (buf[2] == '"') && (buf[3] != '"')) {
len = 3;
add = 1;
buf += 3;
c = *buf;
// handle double quote
} else if (c == '"') {
++beg;