mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 18:48:20 +00:00
GH-2054: Allow nulls as separators for join_string_vec
This commit is contained in:
parent
2f453cd0cd
commit
271d3c4038
3 changed files with 3 additions and 1 deletions
|
@ -102,7 +102,7 @@ function join_string_vec%(vec: string_vec, sep: string%): string
|
||||||
for ( unsigned i = 0; i < v->Size(); ++i )
|
for ( unsigned i = 0; i < v->Size(); ++i )
|
||||||
{
|
{
|
||||||
if ( i > 0 )
|
if ( i > 0 )
|
||||||
d.Add(sep->CheckString(), 0);
|
d.AddN(reinterpret_cast<const char*>(sep->Bytes()), sep->Len());
|
||||||
|
|
||||||
auto e = v->ValAt(i);
|
auto e = v->ValAt(i);
|
||||||
|
|
||||||
|
|
|
@ -3,3 +3,4 @@ this__is__another__test
|
||||||
thisisanothertest
|
thisisanothertest
|
||||||
Test
|
Test
|
||||||
...hi..there
|
...hi..there
|
||||||
|
this\x00is\x00another\x00test
|
||||||
|
|
|
@ -18,4 +18,5 @@ event zeek_init()
|
||||||
print join_string_vec(c, "");
|
print join_string_vec(c, "");
|
||||||
print join_string_vec(d, "-");
|
print join_string_vec(d, "-");
|
||||||
print join_string_vec(e, ".");
|
print join_string_vec(e, ".");
|
||||||
|
print join_string_vec(c, "\x00");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue