MCPcopy Create free account
hub / github.com/catboost/catboost / Unescape

Function Unescape

library/cpp/string_utils/url/url.cpp:400–415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

398#undef X
399
400static inline int Unescape(char* str) {
401 char *to, *from;
402 int dlen = 0;
403 if ((str = strchr(str, '%')) == nullptr)
404 return dlen;
405 for (to = str, from = str; *from; from++, to++) {
406 if ((*to = *from) == '%') {
407 int c = x2c((unsigned char*)from + 1);
408 *to = char((c > 0) ? c : '0');
409 from += 2;
410 dlen += 2;
411 }
412 }
413 *to = 0; /* terminate it at the new length */
414 return dlen;
415}
416
417size_t NormalizeUrlName(char* dest, const TStringBuf source, size_t dest_size) {
418 if (source.empty() || source[0] == '?')

Callers 1

NormalizeUrlNameFunction · 0.70

Calls 2

x2cFunction · 0.85
strchrFunction · 0.50

Tested by

no test coverage detected