Later-chained defs take precedence over more recently chained defs
This commit is contained in:
parent
28efb8937b
commit
8b88c1784e
10
pattern.c
10
pattern.c
@ -169,11 +169,11 @@ pat_t *chain_together(pat_t *first, pat_t *second)
|
|||||||
if (second == NULL) return first;
|
if (second == NULL) return first;
|
||||||
|
|
||||||
if (first->type == BP_DEFINITIONS && second->type == BP_DEFINITIONS) {
|
if (first->type == BP_DEFINITIONS && second->type == BP_DEFINITIONS) {
|
||||||
pat_t *first_end = first;
|
pat_t *second_end = second;
|
||||||
while (first_end->args.def.next_def != NULL)
|
while (second_end->args.def.next_def != NULL)
|
||||||
first_end = first_end->args.def.next_def;
|
second_end = second_end->args.def.next_def;
|
||||||
first_end->args.def.next_def = second;
|
second_end->args.def.next_def = first;
|
||||||
return first;
|
return second;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t minlen = first->min_matchlen + second->min_matchlen;
|
size_t minlen = first->min_matchlen + second->min_matchlen;
|
||||||
|
Loading…
Reference in New Issue
Block a user