aboutsummaryrefslogtreecommitdiff
path: root/src/helperfuncs.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2024-09-02 10:40:47 +0100
committerGravatar Sadie Powell2024-09-02 10:40:47 +0100
commitfaa96b795628bf2d37fee308c05569e1be79b3ae (patch)
tree9563c5f5b0037f8bd112b8aca050475dac9da0c5 /src/helperfuncs.cpp
parentNormalise 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.cpp12
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();