mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
GH-636: Fix regex to handle commas at the end of config parser lines
This commit is contained in:
parent
65ee2287e9
commit
05bb509789
3 changed files with 7 additions and 3 deletions
|
@ -184,8 +184,10 @@ bool Config::DoUpdate()
|
||||||
std::regex re;
|
std::regex re;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
re.assign("^([^[:blank:]]+)[[:blank:]]+([^[:blank:]](.*[^[:blank:]])?)?[[:blank:]]*$",
|
std::string re_str = util::fmt(
|
||||||
std::regex::extended);
|
"^([^[:blank:]]+)[[:blank:]]+([^[:blank:]](.*[^[:blank:]%c])?)?[[:blank:]%c]*$",
|
||||||
|
set_separator[0], set_separator[0]);
|
||||||
|
re.assign(re_str, std::regex::extended);
|
||||||
}
|
}
|
||||||
catch ( const std::regex_error& e )
|
catch ( const std::regex_error& e )
|
||||||
{
|
{
|
||||||
|
|
|
@ -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