fix: subrule can't recursion correctly (#1339)
Some checks are pending
Trigger CMFA Update / trigger-CMFA-update (push) Waiting to run

This commit is contained in:
wwqgtxx 2024-06-22 13:10:09 +08:00
parent 50286678bf
commit a9ecc627e6

View File

@ -2,12 +2,13 @@ package logic
import ( import (
"fmt" "fmt"
list "github.com/bahlo/generic-list-go"
"regexp" "regexp"
"strings" "strings"
C "github.com/metacubex/mihomo/constant" C "github.com/metacubex/mihomo/constant"
"github.com/metacubex/mihomo/rules/common" "github.com/metacubex/mihomo/rules/common"
list "github.com/bahlo/generic-list-go"
) )
type Logic struct { type Logic struct {
@ -243,7 +244,7 @@ func matchSubRules(metadata *C.Metadata, name string, subRules map[string][]C.Ru
for _, rule := range subRules[name] { for _, rule := range subRules[name] {
if m, a := rule.Match(metadata); m { if m, a := rule.Match(metadata); m {
if rule.RuleType() == C.SubRules { if rule.RuleType() == C.SubRules {
matchSubRules(metadata, rule.Adapter(), subRules) return matchSubRules(metadata, rule.Adapter(), subRules)
} else { } else {
return m, a return m, a
} }