diff --git a/src/subexport.cpp b/src/subexport.cpp index e36e87a..245af69 100644 --- a/src/subexport.cpp +++ b/src/subexport.cpp @@ -848,7 +848,7 @@ void rulesetToSurge(INIReader &base_rule, std::vector &ruleset_ } else { - if(count_least(strLine, ',', 3)) + if(!startsWith(strLine, "AND") && !startsWith(strLine, "OR") && !startsWith(strLine, "NOT") && count_least(strLine, ',', 3)) strLine = regReplace(strLine, rule_match_regex, "$1$3$2"); } strLine = replace_all_distinct(strLine, ",,", ","); @@ -987,7 +987,7 @@ void rulesetToSurge(INIReader &base_rule, std::vector &ruleset_ } else { - if(count_least(strLine, ',', 3)) + if(!startsWith(strLine, "AND") && !startsWith(strLine, "OR") && !startsWith(strLine, "NOT") && count_least(strLine, ',', 3)) strLine = regReplace(strLine, rule_match_regex, "$1$3$2"); } allRules.emplace_back(std::move(strLine)); diff --git a/src/templates.cpp b/src/templates.cpp index 455fe9f..0deae85 100644 --- a/src/templates.cpp +++ b/src/templates.cpp @@ -169,6 +169,7 @@ int render_template(const std::string &content, const template_args &vars, std:: switch(hash_(value)) { case "true"_hash: + case "1"_hash: return 1; default: return 0;