@@ -219,48 +219,57 @@ static void copy_rules_phase(apr_pool_t *mp,
219219 exceptions = (rule_exception * * )exceptions_arr -> elts ;
220220 assert (exceptions != NULL );
221221 for (j = 0 ; j < exceptions_arr -> nelts ; j ++ ) {
222-
223222 /* Process exceptions. */
224223 switch (exceptions [j ]-> type ) {
225- case RULE_EXCEPTION_REMOVE_ID :
226- if ((rule -> actionset != NULL )&& (rule -> actionset -> id != NULL )) {
227- int ruleid = atoi (rule -> actionset -> id );
228- if (rule_id_in_range (ruleid , exceptions [j ]-> param )) copy -- ;
224+ case RULE_EXCEPTION_REMOVE_ID :
225+ if ((rule -> actionset != NULL )&& (rule -> actionset -> id != NULL )) {
226+ int ruleid = atoi (rule -> actionset -> id );
227+ if (rule_id_in_range (ruleid , exceptions [j ]-> param )) {
228+ copy = 0 ;
229+ break ;
229230 }
230- break ;
231- case RULE_EXCEPTION_REMOVE_MSG :
232- if ((rule -> actionset != NULL )&& (rule -> actionset -> msg != NULL )) {
233- char * my_error_msg = NULL ;
234-
235- int rc = msc_regexec (exceptions [j ]-> param_data ,
236- rule -> actionset -> msg , strlen (rule -> actionset -> msg ),
237- & my_error_msg );
238- if (rc >= 0 ) copy -- ;
231+ }
232+ break ;
233+ case RULE_EXCEPTION_REMOVE_MSG :
234+ if ((rule -> actionset != NULL )&& (rule -> actionset -> msg != NULL )) {
235+ char * my_error_msg = NULL ;
236+
237+ int rc = msc_regexec (exceptions [j ]-> param_data ,
238+ rule -> actionset -> msg , strlen (rule -> actionset -> msg ),
239+ & my_error_msg );
240+ if (rc >= 0 ) {
241+ copy = 0 ;
242+ break ;
239243 }
240- break ;
241- case RULE_EXCEPTION_REMOVE_TAG :
242- if ((rule -> actionset != NULL )&& (apr_is_empty_table (rule -> actionset -> actions ) == 0 )) {
243- char * my_error_msg = NULL ;
244- const apr_array_header_t * tarr = NULL ;
245- const apr_table_entry_t * telts = NULL ;
246- int c ;
247-
248- tarr = apr_table_elts (rule -> actionset -> actions );
249- telts = (const apr_table_entry_t * )tarr -> elts ;
250-
251- for (c = 0 ; c < tarr -> nelts ; c ++ ) {
252- msre_action * action = (msre_action * )telts [c ].val ;
253- if (strcmp ("tag" , action -> metadata -> name ) == 0 ) {
254-
255- int rc = msc_regexec (exceptions [j ]-> param_data ,
256- action -> param , strlen (action -> param ),
257- & my_error_msg );
258- if (rc >= 0 ) copy -- ;
244+ }
245+ break ;
246+ case RULE_EXCEPTION_REMOVE_TAG :
247+ if ((rule -> actionset != NULL )&& (apr_is_empty_table (rule -> actionset -> actions ) == 0 )) {
248+ char * my_error_msg = NULL ;
249+ const apr_array_header_t * tarr = NULL ;
250+ const apr_table_entry_t * telts = NULL ;
251+ int c ;
252+
253+ tarr = apr_table_elts (rule -> actionset -> actions );
254+ telts = (const apr_table_entry_t * )tarr -> elts ;
255+
256+ for (c = 0 ; c < tarr -> nelts ; c ++ ) {
257+ msre_action * action = (msre_action * )telts [c ].val ;
258+ if (strcmp ("tag" , action -> metadata -> name ) == 0 ) {
259+
260+ int rc = msc_regexec (exceptions [j ]-> param_data ,
261+ action -> param , strlen (action -> param ),
262+ & my_error_msg );
263+ if (rc >= 0 ) {
264+ copy = 0 ;
265+ break ;
259266 }
260267 }
261268 }
262- break ;
269+ }
270+ break ;
263271 }
272+ if (!copy ) break ;
264273 }
265274
266275 if (copy > 0 ) {
0 commit comments