| 398 | #undef X |
| 399 | |
| 400 | static 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 | |
| 417 | size_t NormalizeUrlName(char* dest, const TStringBuf source, size_t dest_size) { |
| 418 | if (source.empty() || source[0] == '?') |
no test coverage detected