From d27e70db8eafad792db6aa3c38253ba6d8b0b42d Mon Sep 17 00:00:00 2001 From: Rikard Falkeborn Date: Tue, 8 Oct 2019 10:38:22 +0200 Subject: [PATCH] bump simplecpp (#2245) --- externals/simplecpp/simplecpp.cpp | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/externals/simplecpp/simplecpp.cpp b/externals/simplecpp/simplecpp.cpp index f94710b35..af48ca27f 100644 --- a/externals/simplecpp/simplecpp.cpp +++ b/externals/simplecpp/simplecpp.cpp @@ -1133,12 +1133,20 @@ std::string simplecpp::TokenList::readUntil(std::istream &istr, const Location & backslash = false; ret += ch; if (ch == '\\') { - const char next = readChar(istr, bom); - if (next == '\r' || next == '\n') { - ret.erase(ret.size()-1U); - backslash = (next == '\r'); - } - ret += next; + bool update_ch = false; + char next = 0; + do { + next = readChar(istr, bom); + if (next == '\r' || next == '\n') { + ret.erase(ret.size()-1U); + backslash = (next == '\r'); + update_ch = false; + } else if (next == '\\') + update_ch = !update_ch; + ret += next; + } while (next == '\\'); + if (update_ch) + ch = next; } }