aboutsummaryrefslogtreecommitdiffstats
path: root/library
diff options
context:
space:
mode:
authorskalsin <skalsin@yandex-team.ru>2022-02-10 16:46:38 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:38 +0300
commit0ec5f3106fcb5e342ec13cdfad678bf4633580d5 (patch)
tree201e92c5c9e5d0123fc5f7be509649e36596dd0b /library
parenta693106aae8a3a3c7236a4ae953058a9611d7a92 (diff)
downloadydb-0ec5f3106fcb5e342ec13cdfad678bf4633580d5.tar.gz
Restoring authorship annotation for <skalsin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library')
-rw-r--r--library/cpp/string_utils/quote/quote.cpp22
-rw-r--r--library/cpp/string_utils/quote/quote_ut.cpp10
2 files changed, 16 insertions, 16 deletions
diff --git a/library/cpp/string_utils/quote/quote.cpp b/library/cpp/string_utils/quote/quote.cpp
index e523350b80..5b0d172874 100644
--- a/library/cpp/string_utils/quote/quote.cpp
+++ b/library/cpp/string_utils/quote/quote.cpp
@@ -180,9 +180,9 @@ TString& AppendCgiEscaped(const TStringBuf value, TString& to) {
// additional characters that should not be quoted — its default value is '/'.
// Also returns pointer to the end of result string.
-
-template <class It1, class It2, class It3>
-static inline It1 Quote(It1 to, It2 from, It3 end, const char* safe) {
+
+template <class It1, class It2, class It3>
+static inline It1 Quote(It1 to, It2 from, It3 end, const char* safe) {
bool escape_map[256];
memcpy(escape_map, chars_to_url_escape, 256);
// RFC 3986 Uniform Resource Identifiers (URI): Generic Syntax
@@ -196,22 +196,22 @@ static inline It1 Quote(It1 to, It2 from, It3 end, const char* safe) {
escape_map[(unsigned char)*p] = 0;
}
- return Escape(to, from, end, escape_map);
-}
-
-char* Quote(char* to, const char* from, const char* safe) {
- return Quote(to, FixZero(from), TCStringEndIterator(), safe);
+ return Escape(to, from, end, escape_map);
}
+char* Quote(char* to, const char* from, const char* safe) {
+ return Quote(to, FixZero(from), TCStringEndIterator(), safe);
+}
+
char* Quote(char* to, const TStringBuf s, const char* safe) {
return Quote(to, s.data(), s.data() + s.size(), safe);
-}
-
+}
+
void Quote(TString& url, const char* safe) {
TTempBuf tempBuf(CgiEscapeBufLen(url.size()));
char* to = tempBuf.Data();
- url.AssignNoAlias(to, Quote(to, url, safe));
+ url.AssignNoAlias(to, Quote(to, url, safe));
}
char* CGIUnescape(char* to, const char* from) {
diff --git a/library/cpp/string_utils/quote/quote_ut.cpp b/library/cpp/string_utils/quote/quote_ut.cpp
index 6c552b279e..0f01b1beb8 100644
--- a/library/cpp/string_utils/quote/quote_ut.cpp
+++ b/library/cpp/string_utils/quote/quote_ut.cpp
@@ -310,10 +310,10 @@ Y_UNIT_TEST_SUITE(TQuoteTest) {
Quote(s, ";,");
UNIT_ASSERT_VALUES_EQUAL("%2Fpath;tail%2Fpath,tail%2F", s.c_str());
}
-
+
Y_UNIT_TEST(StringBuf) {
- char r[100];
- char* end = Quote(r, "abc\0/path", "");
- UNIT_ASSERT_VALUES_EQUAL("abc\0%2Fpath", TStringBuf(r, end));
- }
+ char r[100];
+ char* end = Quote(r, "abc\0/path", "");
+ UNIT_ASSERT_VALUES_EQUAL("abc\0%2Fpath", TStringBuf(r, end));
+ }
}