From faa96b795628bf2d37fee308c05569e1be79b3ae Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Mon, 2 Sep 2024 10:40:47 +0100 Subject: Fix a regression in ProcessColors. We should wait until v5 to be this aggressive with MOTD parsing so we dont break existing users in a minor release. --- src/helperfuncs.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/helperfuncs.cpp') diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 8ee71a4df..a8fc3e541 100644 --- a/src/helperfuncs.cpp +++ b/src/helperfuncs.cpp @@ -194,20 +194,12 @@ void InspIRCd::ProcessColors(std::string& line) auto start = idx; if (++idx >= line.length()) - { - // Stray \ at the end of the string; strip. - line.pop_back(); - continue; - } + continue; // Stray \ at the end of the string; skip. const auto chr = line[idx]; const auto it = formats.find(chr); if (it == formats.end()) - { - // Unknown escape, strip. - line.erase(start, 2); - continue; - } + continue; // Unknown escape, skip. line.replace(start, 2, it->second); idx = start + it->second.length(); -- cgit v1.3.1-10-gc9f91