diff options
author | DexesTTP <dexes.ttp@gmail.com> | 2022-07-05 22:33:15 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-07-06 11:12:45 +0200 |
commit | 7ceeb745354e246ec91cbdcd6f17c8291c09aec0 (patch) | |
tree | ff0acc8f5603d392e0f0b82793df40b257e284ea /Userland/Libraries/LibIMAP/Objects.cpp | |
parent | b2454888e8fa44775456536a2a71827763cba503 (diff) | |
download | serenity-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.cpp | 2 |
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); } |