From c861ba46f106cf6a4d1862ff61b0258a705b2a7c Mon Sep 17 00:00:00 2001 From: Stephan Bosch <stephan@rename-it.nl> Date: Wed, 2 Sep 2009 21:57:48 +0200 Subject: [PATCH] Fixed bug in multiscript support; subsequent keep actions were not always merged correctly. --- src/lib-sieve/sieve-result.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/lib-sieve/sieve-result.c b/src/lib-sieve/sieve-result.c index 3308ce440..c622273bd 100644 --- a/src/lib-sieve/sieve-result.c +++ b/src/lib-sieve/sieve-result.c @@ -379,6 +379,9 @@ static void sieve_result_action_detach(struct sieve_result_action *raction) if ( result->last_action == raction ) result->last_action = raction->prev; + + if ( result->last_attempted_action == raction ) + result->last_attempted_action = raction->prev; if ( raction->next != NULL ) raction->next->prev = raction->prev; if ( raction->prev != NULL ) raction->prev->next = raction->next; @@ -406,7 +409,7 @@ static int _sieve_result_add_action act_data.location = sieve_error_script_location(renv->script, source_line); act_data.context = context; act_data.executed = FALSE; - + /* First, check for duplicates or conflicts */ raction = result->first_action; while ( raction != NULL ) { @@ -415,7 +418,7 @@ static int _sieve_result_add_action if ( keep && raction->keep ) { /* Duplicate keep */ - if ( raction->data.executed ) { + if ( raction->data.action == NULL || raction->data.executed ) { /* Keep action from preceeding execution */ /* Detach existing keep action */ @@ -430,12 +433,11 @@ static int _sieve_result_add_action return ret; } else { /* True duplicate */ - return sieve_result_side_effects_merge (renv, action, raction, seffects); } - } if ( raction->data.action == action ) { + } if ( action != NULL && raction->data.action == action ) { instance_count++; /* Possible duplicate */ @@ -509,10 +511,10 @@ static int _sieve_result_add_action return -1; } - if ( kaction != NULL ) + if ( kaction != NULL ) { /* Use existing keep action to define new one */ raction = kaction; - else { + } else { /* Create new action object */ raction = p_new(result->pool, struct sieve_result_action, 1); raction->data.executed = FALSE; -- GitLab