GH-2054: Allow nulls as separators for join_string_vec

This commit is contained in:
Tim Wojtulewicz 2022-05-25 17:03:26 -07:00
parent 2f453cd0cd
commit 271d3c4038
3 changed files with 3 additions and 1 deletions

View file

@ -102,7 +102,7 @@ function join_string_vec%(vec: string_vec, sep: string%): string
for ( unsigned i = 0; i < v->Size(); ++i )
{
if ( i > 0 )
d.Add(sep->CheckString(), 0);
d.AddN(reinterpret_cast<const char*>(sep->Bytes()), sep->Len());
auto e = v->ValAt(i);

View file

@ -3,3 +3,4 @@ this__is__another__test
thisisanothertest
Test
...hi..there
this\x00is\x00another\x00test

View file

@ -18,4 +18,5 @@ event zeek_init()
print join_string_vec(c, "");
print join_string_vec(d, "-");
print join_string_vec(e, ".");
print join_string_vec(c, "\x00");
}