Skip to content

Commit d27e70d

Browse files
rikardfalkeborndanmar
authored andcommitted
bump simplecpp (danmar#2245)
1 parent 93e9e12 commit d27e70d

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

externals/simplecpp/simplecpp.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1133,12 +1133,20 @@ std::string simplecpp::TokenList::readUntil(std::istream &istr, const Location &
11331133
backslash = false;
11341134
ret += ch;
11351135
if (ch == '\\') {
1136-
const char next = readChar(istr, bom);
1137-
if (next == '\r' || next == '\n') {
1138-
ret.erase(ret.size()-1U);
1139-
backslash = (next == '\r');
1140-
}
1141-
ret += next;
1136+
bool update_ch = false;
1137+
char next = 0;
1138+
do {
1139+
next = readChar(istr, bom);
1140+
if (next == '\r' || next == '\n') {
1141+
ret.erase(ret.size()-1U);
1142+
backslash = (next == '\r');
1143+
update_ch = false;
1144+
} else if (next == '\\')
1145+
update_ch = !update_ch;
1146+
ret += next;
1147+
} while (next == '\\');
1148+
if (update_ch)
1149+
ch = next;
11421150
}
11431151
}
11441152

0 commit comments

Comments
 (0)