diff --git a/scripts/base/frameworks/input/readers/config.bro b/scripts/base/frameworks/input/readers/config.bro index f97323d4a5..166228e81f 100644 --- a/scripts/base/frameworks/input/readers/config.bro +++ b/scripts/base/frameworks/input/readers/config.bro @@ -8,7 +8,9 @@ export { const set_separator = Input::set_separator &redef; ## String to use for empty fields. - const empty_field = Input::empty_field &redef; + ## By default this is the empty string, meaning that an empty input field + ## will result in an empty set. + const empty_field = "" &redef; ## Fail on file read problems. If set to true, the config ## input reader will fail when encountering any problems diff --git a/src/threading/formatters/Ascii.cc b/src/threading/formatters/Ascii.cc index 1398a89d9b..e96290e793 100644 --- a/src/threading/formatters/Ascii.cc +++ b/src/threading/formatters/Ascii.cc @@ -329,6 +329,9 @@ threading::Value* Ascii::ParseValue(const string& s, const string& name, TypeTag if ( separators.empty_field.size() > 0 && s.compare(separators.empty_field) == 0 ) length = 0; + if ( separators.empty_field.empty() && s.empty() ) + length = 0; + threading::Value** lvals = new threading::Value* [length]; if ( type == TYPE_TABLE ) diff --git a/testing/btest/scripts/base/frameworks/config/basic.bro b/testing/btest/scripts/base/frameworks/config/basic.bro index 19a1ecc64a..3b72f6572d 100644 --- a/testing/btest/scripts/base/frameworks/config/basic.bro +++ b/testing/btest/scripts/base/frameworks/config/basic.bro @@ -22,7 +22,7 @@ testinterval 60 testtime 1507321987 test_set a,b,c,d,erdbeerschnitzel test_vector 1,2,3,4,5,6 -test_set (empty) +test_set test_set - @TEST-END-FILE diff --git a/testing/btest/scripts/base/frameworks/config/read_config.bro b/testing/btest/scripts/base/frameworks/config/read_config.bro index 847bab6f8a..753186beab 100644 --- a/testing/btest/scripts/base/frameworks/config/read_config.bro +++ b/testing/btest/scripts/base/frameworks/config/read_config.bro @@ -6,6 +6,7 @@ @load base/protocols/conn redef exit_only_after_terminate = T; +redef InputConfig::empty_field = "(empty)"; @TEST-START-FILE configfile testbool F