mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 18:48:20 +00:00
Reimplement fixes to handle commas at the end of config parser lines
This commit is contained in:
parent
777dff18cd
commit
187773eaa3
3 changed files with 8 additions and 3 deletions
|
@ -181,9 +181,12 @@ bool Config::DoUpdate()
|
||||||
unseen_options.insert(i.first);
|
unseen_options.insert(i.first);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string re_str = Fmt(
|
||||||
|
"^([^[:blank:]]+)[[:blank:]]+([^[:blank:]](.*[^[:blank:]%c])?)?[[:blank:]%c]*$",
|
||||||
|
set_separator[0], set_separator[0]);
|
||||||
|
|
||||||
regex_t re;
|
regex_t re;
|
||||||
if ( regcomp(&re, "^([^[:blank:]]+)[[:blank:]]+([^[:blank:]](.*[^[:blank:]])?)?[[:blank:]]*$",
|
if ( regcomp(&re, re_str.c_str(), REG_EXTENDED) )
|
||||||
REG_EXTENDED) )
|
|
||||||
{
|
{
|
||||||
Error(Fmt("Failed to compile regex."));
|
Error(Fmt("Failed to compile regex."));
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -23,7 +23,8 @@ XXXXXXXXXX.XXXXXX testsub 2607:f8b0:4001::/48 2607:f8b0:4002::/48 ../configfile
|
||||||
XXXXXXXXXX.XXXXXX testinterval 1.0 sec 1.0 min ../configfile
|
XXXXXXXXXX.XXXXXX testinterval 1.0 sec 1.0 min ../configfile
|
||||||
XXXXXXXXXX.XXXXXX testtime 0.0 XXXXXXXXXX.XXXXXX ../configfile
|
XXXXXXXXXX.XXXXXX testtime 0.0 XXXXXXXXXX.XXXXXX ../configfile
|
||||||
XXXXXXXXXX.XXXXXX test_set (empty) a,d,b,c,erdbeerschnitzel ../configfile
|
XXXXXXXXXX.XXXXXX test_set (empty) a,d,b,c,erdbeerschnitzel ../configfile
|
||||||
|
XXXXXXXXXX.XXXXXX test_set a,d,b,c,erdbeerschnitzel a,c,b ../configfile
|
||||||
XXXXXXXXXX.XXXXXX test_vector (empty) 1,2,3,4,5,6 ../configfile
|
XXXXXXXXXX.XXXXXX test_vector (empty) 1,2,3,4,5,6 ../configfile
|
||||||
XXXXXXXXXX.XXXXXX test_set a,d,b,c,erdbeerschnitzel (empty) ../configfile
|
XXXXXXXXXX.XXXXXX test_set a,c,b (empty) ../configfile
|
||||||
XXXXXXXXXX.XXXXXX test_set (empty) \x2d ../configfile
|
XXXXXXXXXX.XXXXXX test_set (empty) \x2d ../configfile
|
||||||
#close XXXX-XX-XX-XX-XX-XX
|
#close XXXX-XX-XX-XX-XX-XX
|
||||||
|
|
|
@ -27,6 +27,7 @@ testsub [2607:f8b0:4002:801::]/48
|
||||||
testinterval 60
|
testinterval 60
|
||||||
testtime 1507321987
|
testtime 1507321987
|
||||||
test_set a,b,c,d,erdbeerschnitzel
|
test_set a,b,c,d,erdbeerschnitzel
|
||||||
|
test_set a,b,c,
|
||||||
test_vector 1,2,3,4,5,6
|
test_vector 1,2,3,4,5,6
|
||||||
test_set
|
test_set
|
||||||
test_set -
|
test_set -
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue