Skip to content
Snippets Groups Projects
Commit feb156bd authored by ilor's avatar ilor
Browse files

avoid erroring when there are norules of some type in wccl-rules

parent b1e4d384
Branches
No related merge requests found
...@@ -92,10 +92,15 @@ std::pair<int,int> RuleRunner::load_more_rules(const std::string& filename) ...@@ -92,10 +92,15 @@ std::pair<int,int> RuleRunner::load_more_rules(const std::string& filename)
if (parsed_file) { if (parsed_file) {
boost::filesystem::path p(filename); boost::filesystem::path p(filename);
file_names_.push_back(p.stem()); file_names_.push_back(p.stem());
size_t match_rules = parsed_file->get_match_rules().size(); size_t match_rules = 0, tag_rules = 0;
size_t tag_rules = parsed_file->get_tag_rules().size(); if (parsed_file->has_tag_rules()) {
total_match_rules_ += match_rules; tag_rules = parsed_file->get_tag_rules().size();
}
if (parsed_file->has_match_rules()) {
match_rules = parsed_file->get_match_rules().size();
}
total_tag_rules_ += tag_rules; total_tag_rules_ += tag_rules;
total_match_rules_ += match_rules;
parsed_files_.push_back(parsed_file); parsed_files_.push_back(parsed_file);
return std::make_pair(tag_rules, match_rules); return std::make_pair(tag_rules, match_rules);
} else { } else {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment