summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibIMAP/Objects.cpp
diff options
context:
space:
mode:
authorDexesTTP <dexes.ttp@gmail.com>2022-07-05 22:33:15 +0200
committerLinus Groh <mail@linusgroh.de>2022-07-06 11:12:45 +0200
commit7ceeb745354e246ec91cbdcd6f17c8291c09aec0 (patch)
treeff0acc8f5603d392e0f0b82793df40b257e284ea /Userland/Libraries/LibIMAP/Objects.cpp
parentb2454888e8fa44775456536a2a71827763cba503 (diff)
downloadserenity-7ceeb745354e246ec91cbdcd6f17c8291c09aec0.zip
AK: Use an enum instead of a bool for String::replace(all_occurences)
This commit has no behavior changes. In particular, this does not fix any of the wrong uses of the previous default parameter (which used to be 'false', meaning "only replace the first occurence in the string"). It simply replaces the default uses by String::replace(..., ReplaceMode::FirstOnly), leaving them incorrect.
Diffstat (limited to 'Userland/Libraries/LibIMAP/Objects.cpp')
-rw-r--r--Userland/Libraries/LibIMAP/Objects.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibIMAP/Objects.cpp b/Userland/Libraries/LibIMAP/Objects.cpp
index abce49692f..23dbdf5e83 100644
--- a/Userland/Libraries/LibIMAP/Objects.cpp
+++ b/Userland/Libraries/LibIMAP/Objects.cpp
@@ -128,7 +128,7 @@ String serialize_astring(StringView string)
// Try to quote
auto can_be_quoted = !(string.contains('\n') || string.contains('\r'));
if (can_be_quoted) {
- auto escaped_str = string.replace("\\", "\\\\").replace("\"", "\\\"");
+ auto escaped_str = string.replace("\\", "\\\\", ReplaceMode::FirstOnly).replace("\"", "\\\"", ReplaceMode::FirstOnly);
return String::formatted("\"{}\"", escaped_str);
}