From ffd18e6b5d4c8c941f65a2867163db68bb719694 Mon Sep 17 00:00:00 2001 From: Solar Designer Date: Sun, 29 Sep 2024 04:20:54 +0200 Subject: [PATCH] Fix handling of --rules-stack along with batch mode See #5524 Fixes cd8d511847dca14d0cbadabc2d6587ae99cf5352 --- src/rules.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rules.c b/src/rules.c index a80c99e03..428bdee0a 100644 --- a/src/rules.c +++ b/src/rules.c @@ -611,7 +611,7 @@ int rules_init_stack(char *ruleset, rule_stack *stack_ctx, log_event("- No stacked rules"); } - rules_stacked_after = rule_count && (options.flags & (FLG_RULES_CHK | FLG_SINGLE_CHK)); + rules_stacked_after = rule_count && (options.flags & (FLG_RULES_CHK | FLG_SINGLE_CHK | FLG_BATCH_CHK)); return rule_count; } @@ -639,7 +639,7 @@ void rules_init(struct db_main *db, int max_length) } rules_init_length(max_length); - rules_stacked_after = (options.flags & (FLG_RULES_CHK | FLG_SINGLE_CHK)) && (options.flags & FLG_RULES_STACK_CHK); + rules_stacked_after = (options.flags & (FLG_RULES_CHK | FLG_SINGLE_CHK | FLG_BATCH_CHK)) && (options.flags & FLG_RULES_STACK_CHK); } char *rules_reject(char *rule, int split, char *last, struct db_main *db) @@ -1868,7 +1868,7 @@ char *rules_process_stack(char *key, rule_stack *ctx) if ((word = rules_apply(key, ctx->rule->data, -1, last))) last = word; - rules_stacked_after = !!(options.flags & (FLG_RULES_CHK | FLG_SINGLE_CHK)); + rules_stacked_after = !!(options.flags & (FLG_RULES_CHK | FLG_SINGLE_CHK | FLG_BATCH_CHK)); return word; } @@ -1908,7 +1908,7 @@ char *rules_process_stack_all(char *key, rule_stack *ctx) } } - rules_stacked_after = !!(options.flags & (FLG_RULES_CHK | FLG_SINGLE_CHK)); + rules_stacked_after = !!(options.flags & (FLG_RULES_CHK | FLG_SINGLE_CHK | FLG_BATCH_CHK)); if (!stack_rules_mute && options.verbosity <= VERB_DEFAULT) { stack_rules_mute = 1;