forked from qt-creator/qt-creator
fix read beyond end of input line
a line ending in two backslashes would produce a literal backslash and run off the end. Task-number: QTCREATORBUG-3360
This commit is contained in:
@@ -422,7 +422,7 @@ bool ProFileParser::read(ProFile *pro, const QString &in)
|
||||
} while (c == ' ' || c == '\t');
|
||||
forever {
|
||||
if (c == '$') {
|
||||
if (*cur == '$') { // may be EOF, EOL, WS or '#' if past end
|
||||
if (*cur == '$') { // may be EOF, EOL, WS, '#' or '\\' if past end
|
||||
cur++;
|
||||
if (putSpace) {
|
||||
putSpace = false;
|
||||
@@ -541,7 +541,7 @@ bool ProFileParser::read(ProFile *pro, const QString &in)
|
||||
xprPtr = ptr;
|
||||
goto nextChr;
|
||||
}
|
||||
} else if (c == '\\') {
|
||||
} else if (c == '\\' && cur != end) {
|
||||
static const char symbols[] = "[]{}()$\\'\"";
|
||||
ushort c2 = *cur;
|
||||
if (!(c2 & 0xff00) && strchr(symbols, c2)) {
|
||||
|
||||
Reference in New Issue
Block a user