]> source.dussan.org Git - rspamd.git/commitdiff
Fix inversion logic.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 24 Mar 2015 13:49:13 +0000 (13:49 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 24 Mar 2015 13:49:13 +0000 (13:49 +0000)
src/libutil/expression.c

index 77627becfb52bf9ad6a3eb1534ccaeb5b45c0099..06a3af8e85db3c0b5dd7fdc0350c078f34657bdd 100644 (file)
@@ -595,6 +595,13 @@ rspamd_process_expression (struct rspamd_expression *expr, gpointer data)
                                        st_elt[0]->flags |= RSPAMD_EXPR_FLAG_NEGATE;
                                }
 
+                               if (st_elt[0]->flags & RSPAMD_EXPR_FLAG_PROCESSED) {
+                                       /* Inverse the value */
+                                       if ((st_elt[0]->flags & RSPAMD_EXPR_FLAG_NEGATE)) {
+                                               st_elt[0]->value = !st_elt[0]->value;
+                                       }
+                               }
+
                                rspamd_expr_stack_push (expr, st_elt[0]);
                                break;
                        case OP_OR: