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.
This commit is contained in:
Sadie Powell 2024-09-02 10:40:47 +01:00
parent f6da60b3f4
commit faa96b7956

View File

@ -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();