aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/string/format-inl.h
diff options
context:
space:
mode:
authorbulatman <bulatman@yandex-team.com>2023-06-28 13:55:58 +0300
committerbulatman <bulatman@yandex-team.com>2023-06-28 13:55:58 +0300
commit938064d942bb0c4149dd0118ad5e0ddde2297783 (patch)
tree1b05df8c75016a5667c480143e822c300e7233c5 /library/cpp/yt/string/format-inl.h
parent6d6a460c697933b882700556bf2344c51a789174 (diff)
downloadydb-938064d942bb0c4149dd0118ad5e0ddde2297783.tar.gz
YT: Escape back slash when format string with quotes
Diffstat (limited to 'library/cpp/yt/string/format-inl.h')
-rw-r--r--library/cpp/yt/string/format-inl.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/library/cpp/yt/string/format-inl.h b/library/cpp/yt/string/format-inl.h
index a6a15485eb..2eb42cfb99 100644
--- a/library/cpp/yt/string/format-inl.h
+++ b/library/cpp/yt/string/format-inl.h
@@ -91,6 +91,8 @@ inline void FormatValue(TStringBuilderBase* builder, TStringBuf value, TStringBu
builder->AppendString("\\n");
} else if (ch == '\t') {
builder->AppendString("\\t");
+ } else if (ch == '\\') {
+ builder->AppendString("\\\\");
} else if (ch < PrintableASCIILow || ch > PrintableASCIIHigh) {
builder->AppendString("\\x");
builder->AppendChar(IntToHexLowercase[static_cast<ui8>(ch) >> 4]);