mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 01:51:59 +00:00
clickhouse: fixed function cutURLParameter [#CONV-6788].
This commit is contained in:
parent
f933440e9c
commit
c2612d08e1
@ -386,14 +386,15 @@ struct CutURLParameterImpl
|
||||
/// Захватим ';' или '&' до или после параметра.
|
||||
if (*end_pos == ';' || *end_pos == '&')
|
||||
++end_pos;
|
||||
else if (*(begin_pos-1) == ';' || *(begin_pos) == '&')
|
||||
else if (*(begin_pos - 1) == ';' || *(begin_pos - 1) == '&')
|
||||
--begin_pos;
|
||||
} while (false);
|
||||
|
||||
res_data.resize(res_offset + (url_end - url_begin) + 1);
|
||||
size_t cut_length = (url_end - url_begin) - (end_pos - begin_pos);
|
||||
res_data.resize(res_offset + cut_length + 1);
|
||||
memcpy(&res_data[res_offset], url_begin, begin_pos - url_begin);
|
||||
memcpy(&res_data[res_offset] + (begin_pos - url_begin), end_pos, url_end - end_pos);
|
||||
res_offset += url_end - url_begin + 1;
|
||||
res_offset += cut_length + 1;
|
||||
res_data[res_offset - 1] = 0;
|
||||
res_offsets[i] = res_offset;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user