mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 10:38: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 )
|
||||
{
|
||||
if ( i > 0 )
|
||||
d.Add(sep->CheckString(), 0);
|
||||
d.AddN(reinterpret_cast<const char*>(sep->Bytes()), sep->Len());
|
||||
|
||||
auto e = v->ValAt(i);
|
||||
|
||||
|
|
|
@ -3,3 +3,4 @@ this__is__another__test
|
|||
thisisanothertest
|
||||
Test
|
||||
...hi..there
|
||||
this\x00is\x00another\x00test
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue