summaryrefslogtreecommitdiff
path: root/libmu_sieve
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2016-12-13 22:05:06 +0200
committerSergey Poznyakoff <gray@gnu.org>2016-12-13 22:05:06 +0200
commitfd04041628827f09e0b0c57e41491346357760e1 (patch)
tree7463715b31e2430c271c426405de9dfa84ac2011 /libmu_sieve
parent985be0a2ebef0671c1eee2f160c8c366e806316e (diff)
downloadmailutils-fd04041628827f09e0b0c57e41491346357760e1.tar.gz
mailutils-fd04041628827f09e0b0c57e41491346357760e1.tar.bz2
Version 3.1
* configure.ac: version 3.1 * NEWS: Likewise. * libmu_sieve/comparator.c: Attend to FIXMEs. * libmu_sieve/conf.c: Likewise. * libmu_sieve/prog.c: Likewise. * libmu_sieve/runtime.c: Likewise. * libmu_sieve/sieve.y: Likewise. * libmu_sieve/util.c: Likewise. * libmu_sieve/variables.c: Likewise. * po/POTFILES.in: Add new files.
Diffstat (limited to 'libmu_sieve')
-rw-r--r--libmu_sieve/comparator.c7
-rw-r--r--libmu_sieve/conf.c1
-rw-r--r--libmu_sieve/prog.c28
-rw-r--r--libmu_sieve/runtime.c2
-rw-r--r--libmu_sieve/sieve.y7
-rw-r--r--libmu_sieve/util.c1
-rw-r--r--libmu_sieve/variables.c2
7 files changed, 28 insertions, 20 deletions
diff --git a/libmu_sieve/comparator.c b/libmu_sieve/comparator.c
index e9936b824..9177c1086 100644
--- a/libmu_sieve/comparator.c
+++ b/libmu_sieve/comparator.c
@@ -266,7 +266,10 @@ mu_sieve_match_part_checker (mu_sieve_machine_t mach)
}
}
else
- abort ();//FIXME
+ {
+ mu_error (_("%s:%d: INTERNAL ERROR, please report"), __FILE__, __LINE__);
+ abort ();
+ }
if (!compfun)
{
@@ -400,7 +403,7 @@ i_ascii_numeric_is (mu_sieve_machine_t mach,
if (mu_isdigit (*str))
{
if (mu_isdigit (*text))
- //FIXME: Error checking
+ /* FIXME: Error checking */
return strtol (str, NULL, 10) == strtol (text, NULL, 10);
else
return 0;
diff --git a/libmu_sieve/conf.c b/libmu_sieve/conf.c
index 82ec77e01..9b9b0d95f 100644
--- a/libmu_sieve/conf.c
+++ b/libmu_sieve/conf.c
@@ -45,7 +45,6 @@ struct sieve_settings
};
static struct sieve_settings sieve_settings;
-/*FIXME: REMOVE BEGIN */
static int
_path_append (void *item, void *data)
{
diff --git a/libmu_sieve/prog.c b/libmu_sieve/prog.c
index 6ab96091e..3565a6622 100644
--- a/libmu_sieve/prog.c
+++ b/libmu_sieve/prog.c
@@ -148,7 +148,7 @@ mu_i_sv_lint_command (struct mu_sieve_machine *mach,
exp_arg = reg->v.command.req_args ? reg->v.command.req_args : empty;
- /* Pass 1: consolidation */
+ /* Pass 1: tag consolidation and argument checking */
for (i = 0; i < node->v.command.argcount; i++)
{
mu_sieve_value_t *val = start + i;
@@ -223,9 +223,19 @@ mu_i_sv_lint_command (struct mu_sieve_machine *mach,
err = 1;
break;
}
- //FIXME
if (mu_list_foreach (chk_list, _compare_ptr, cf) == 0)
- mu_list_append (chk_list, cf);
+ {
+ rc = mu_list_append (chk_list, cf);
+ if (rc)
+ {
+ mu_diag_at_locus (MU_LOG_ERROR, &mach->locus,
+ "mu_list_append: %s",
+ mu_strerror (rc));
+ mu_i_sv_error (mach);
+ err = 1;
+ break;
+ }
+ }
}
}
else
@@ -288,19 +298,19 @@ mu_i_sv_lint_command (struct mu_sieve_machine *mach,
if (node->v.command.tagcount)
{
- /* Move tags to the end of the list */
+ /* Pass 2: Move tags to the end of the list */
for (i = 1; i < node->v.command.argcount; i++)
{
- int j;//FIXME
+ size_t j;
mu_sieve_value_t tmp = start[i];
- for (j = i - 1; j >= 0; j--)
+ for (j = i; j > 0; j--)
{
- if (!tmp.tag && start[j].tag)
- start[j + 1] = start[j];
+ if (!tmp.tag && start[j - 1].tag)
+ start[j] = start[j - 1];
else
break;
}
- start[j + 1] = tmp;
+ start[j] = tmp;
}
}
diff --git a/libmu_sieve/runtime.c b/libmu_sieve/runtime.c
index b5739e003..b067bc22a 100644
--- a/libmu_sieve/runtime.c
+++ b/libmu_sieve/runtime.c
@@ -228,7 +228,7 @@ int
mu_sieve_set_dry_run (mu_sieve_machine_t mach, int val)
{
if (mach->state != mu_sieve_state_compiled)
- return EINVAL; //FIXME: another error code
+ return EINVAL; /* FIXME: another error code */
return mach->dry_run = val;
}
diff --git a/libmu_sieve/sieve.y b/libmu_sieve/sieve.y
index e39ac7275..9c3341a04 100644
--- a/libmu_sieve/sieve.y
+++ b/libmu_sieve/sieve.y
@@ -1007,10 +1007,8 @@ mu_i_sv_free_stringspace (mu_sieve_machine_t mach)
regex_t *rx = mach->stringspace[i].rx;
regfree (rx);
}
- /* FIXME: Is it needed?
- if (mach->stringspace[i].exp)
- free (mach->stringspace[i].exp);
- */
+ /* There's no need to free mach->stringspace[i].exp, because
+ it is allocated in mach's memory pool */
}
}
@@ -1575,7 +1573,6 @@ sieve_compile_strbuf (void *name)
return MU_ERR_FAILURE;
}
-//FIXME: The API is clumsy
int
mu_sieve_compile_buffer (mu_sieve_machine_t mach,
const char *str, int strsize,
diff --git a/libmu_sieve/util.c b/libmu_sieve/util.c
index ae46d5231..59632aec5 100644
--- a/libmu_sieve/util.c
+++ b/libmu_sieve/util.c
@@ -81,7 +81,6 @@ mu_sieve_get_arg_untyped (mu_sieve_machine_t mach, size_t index)
mach->tagcount,
index);
abort ();
- //FIXME mu_sieve_abort (mach);
}
return mach->valspace + mach->argstart + index;
diff --git a/libmu_sieve/variables.c b/libmu_sieve/variables.c
index c73b7e8d0..6f58e54c1 100644
--- a/libmu_sieve/variables.c
+++ b/libmu_sieve/variables.c
@@ -156,7 +156,7 @@ findprec (char const *name)
for (i = 0; i < MU_ARRAY_SIZE (modprec); i++)
if (strcmp (modprec[i].name, name) == 0)
return &modprec[i];
- mu_error ("%s:%d: INTERNAL ERROR", __FILE__, __LINE__);
+ mu_error (_("%s:%d: INTERNAL ERROR, please report"), __FILE__, __LINE__);
abort ();
}

Return to:

Send suggestions and report system problems to the System administrator.