aboutsummaryrefslogtreecommitdiffstats
path: root/src/libutil
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-03-26 23:38:06 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-03-26 23:38:06 +0000
commite7249e44653a7904eae1c422503015a2ee962d76 (patch)
treefe2249a8d6c5b1fb91f4e059ca8166ddb9fce963 /src/libutil
parenta1f31d72a27030420c3c8d9ab9d7e238d9d2ed85 (diff)
downloadrspamd-e7249e44653a7904eae1c422503015a2ee962d76.tar.gz
rspamd-e7249e44653a7904eae1c422503015a2ee962d76.zip
Fix order of N-ary operators merging.
Diffstat (limited to 'src/libutil')
-rw-r--r--src/libutil/expression.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/libutil/expression.c b/src/libutil/expression.c
index af8a54fff..b7f178b00 100644
--- a/src/libutil/expression.c
+++ b/src/libutil/expression.c
@@ -354,7 +354,7 @@ rspamd_ast_add_node (GPtrArray *operands, struct rspamd_expression_elt *op)
if (test_elt->type == ELT_OP && test_elt->p.op == op->p.op) {
/* Add children */
- g_node_append (test, a1);
+ g_node_prepend (test, a1);
rspamd_expr_stack_elt_push (operands, a2);
return;
}
@@ -418,16 +418,10 @@ rspamd_ast_priority_cmp (GNode *a, GNode *b)
static gboolean
rspamd_ast_resort_traverse (GNode *node, gpointer unused)
{
- GNode *cur;
-
- cur = node->children;
-
- if (cur) {
- DL_SORT (cur, rspamd_ast_priority_cmp);
+ if (node->children) {
+ DL_SORT (node->children, rspamd_ast_priority_cmp);
}
- node->children = cur;
-
return FALSE;
}