Commit b5025fea b5025fea376e643bee34f266425c0b787637099b by Sergey Poznyakoff

(sieve_require): Handle "comparator-" prefix in require statements.

1 parent 0093f3b1
......@@ -43,20 +43,34 @@ sieve_require (list_t slist)
for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr))
{
char *s;
sieve_register_t *reg;
iterator_current (itr, (void **)&s);
/* FIXME: if (strncmp (s, "comparator-", 11) ... */
reg = sieve_action_lookup (s);
if (!reg)
if (strncmp (s, "comparator-", 11) == 0)
{
sieve_compile_error (sieve_filename, sieve_line_num,
"source for the required action %s is not available",
s);
break;
if (sieve_require_comparator (s + 11))
{
sieve_compile_error (sieve_filename, sieve_line_num,
"source for the required comparator %s is not available",
s + 11);
}
}
else if (strncmp (s, "test-", 5) == 0) /* GNU extension */
{
}
else
{
sieve_register_t *reg;
reg = sieve_action_lookup (s);
if (!reg)
{
sieve_compile_error (sieve_filename, sieve_line_num,
"source for the required action %s is not available",
s);
break;
}
reg->required = 1;
}
reg->required = 1;
}
iterator_destroy (&itr);
}
......