(sieve_require): Handle "comparator-" prefix in require statements.
Showing
1 changed file
with
23 additions
and
9 deletions
... | @@ -43,20 +43,34 @@ sieve_require (list_t slist) | ... | @@ -43,20 +43,34 @@ sieve_require (list_t slist) |
43 | for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr)) | 43 | for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr)) |
44 | { | 44 | { |
45 | char *s; | 45 | char *s; |
46 | sieve_register_t *reg; | ||
47 | 46 | ||
48 | iterator_current (itr, (void **)&s); | 47 | iterator_current (itr, (void **)&s); |
49 | 48 | ||
50 | /* FIXME: if (strncmp (s, "comparator-", 11) ... */ | 49 | if (strncmp (s, "comparator-", 11) == 0) |
51 | reg = sieve_action_lookup (s); | ||
52 | if (!reg) | ||
53 | { | 50 | { |
54 | sieve_compile_error (sieve_filename, sieve_line_num, | 51 | if (sieve_require_comparator (s + 11)) |
55 | "source for the required action %s is not available", | 52 | { |
56 | s); | 53 | sieve_compile_error (sieve_filename, sieve_line_num, |
57 | break; | 54 | "source for the required comparator %s is not available", |
55 | s + 11); | ||
56 | } | ||
57 | } | ||
58 | else if (strncmp (s, "test-", 5) == 0) /* GNU extension */ | ||
59 | { | ||
60 | } | ||
61 | else | ||
62 | { | ||
63 | sieve_register_t *reg; | ||
64 | reg = sieve_action_lookup (s); | ||
65 | if (!reg) | ||
66 | { | ||
67 | sieve_compile_error (sieve_filename, sieve_line_num, | ||
68 | "source for the required action %s is not available", | ||
69 | s); | ||
70 | break; | ||
71 | } | ||
72 | reg->required = 1; | ||
58 | } | 73 | } |
59 | reg->required = 1; | ||
60 | } | 74 | } |
61 | iterator_destroy (&itr); | 75 | iterator_destroy (&itr); |
62 | } | 76 | } | ... | ... |
-
Please register or sign in to post a comment