diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2016-12-13 23:42:59 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2016-12-13 23:47:33 +0200 |
commit | 678d936783f591bcf7c3f8acafd0152a3c1b0b61 (patch) | |
tree | 648dd27f9de3149ee1312c64216f848db7bbe415 /libmu_sieve | |
parent | 6f32dede6a5a483b4f34c462baf64ae86d15b5f9 (diff) | |
download | mailutils-678d936783f591bcf7c3f8acafd0152a3c1b0b61.tar.gz mailutils-678d936783f591bcf7c3f8acafd0152a3c1b0b61.tar.bz2 |
Minor changes in sieve.
* libmu_sieve/runtime.c (mu_sieve_abort): Jump with code MU_ERR_FAILURE.
* libmu_sieve/tests.c (retrieve_address): Tolerate empty addresses.
(retrieve_header): Return reasonable error code.
* maidag/script.c (script_apply): If the script failed, return 0.
Diffstat (limited to 'libmu_sieve')
-rw-r--r-- | libmu_sieve/runtime.c | 2 | ||||
-rw-r--r-- | libmu_sieve/tests.c | 8 |
2 files changed, 4 insertions, 6 deletions
diff --git a/libmu_sieve/runtime.c b/libmu_sieve/runtime.c index b067bc22a..6d320a45d 100644 --- a/libmu_sieve/runtime.c +++ b/libmu_sieve/runtime.c @@ -157,7 +157,7 @@ _mu_i_sv_instr_brnz (mu_sieve_machine_t mach) void mu_sieve_abort (mu_sieve_machine_t mach) { - longjmp (mach->errbuf, 1); + longjmp (mach->errbuf, MU_ERR_FAILURE); } void diff --git a/libmu_sieve/tests.c b/libmu_sieve/tests.c index ba0e6e61b..00612c13d 100644 --- a/libmu_sieve/tests.c +++ b/libmu_sieve/tests.c @@ -67,6 +67,8 @@ retrieve_address (void *item, void *data, size_t idx, char **pval) rc = mu_header_aget_value ((mu_header_t)ap->data, (char*)item, &val); if (rc) return rc; + if (mu_str_skip_class (val, MU_CTYPE_BLANK)[0] == 0) + return MU_ERR_NOENT; rc = mu_address_create (&ap->addr, val); free (val); if (rc) @@ -150,11 +152,7 @@ retrieve_header (void *item, void *data, size_t idx, char **pval) { int i = hc->index++; if (mu_c_strcasecmp (hname, (char*)item) == 0) - { - if (mu_header_aget_field_value_unfold (hc->header, i, pval)) - return -1; - return 0; - } + return mu_header_aget_field_value_unfold (hc->header, i, pval); } hc->header = NULL; |