diff options
| author | 2024-09-02 10:40:47 +0100 | |
|---|---|---|
| committer | 2024-09-02 10:40:47 +0100 | |
| commit | faa96b795628bf2d37fee308c05569e1be79b3ae (patch) | |
| tree | 9563c5f5b0037f8bd112b8aca050475dac9da0c5 /src/helperfuncs.cpp | |
| parent | Normalise the case of MOD_RESULT variables. (diff) | |
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.
Diffstat (limited to 'src/helperfuncs.cpp')
| -rw-r--r-- | src/helperfuncs.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
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(); |
