summaryrefslogtreecommitdiff
path: root/libsieve
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2005-02-25 11:02:14 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2005-02-25 11:02:14 +0000
commitbf77e1c15d4a4356d1f8a0ffbcaeb42ca6903203 (patch)
tree6888f418204951b6aa236811c4401e14a9fc4164 /libsieve
parent7a53eb351fd4c7fc2e1092bb6037846e60fff6a9 (diff)
downloadmailutils-bf77e1c15d4a4356d1f8a0ffbcaeb42ca6903203.tar.gz
mailutils-bf77e1c15d4a4356d1f8a0ffbcaeb42ca6903203.tar.bz2
(sieve_value_create): Bugfix.
(sieve_error): Prepend action or test identifier to the diagnostic message. (sieve_arg_error): New function.
Diffstat (limited to 'libsieve')
-rw-r--r--libsieve/util.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/libsieve/util.c b/libsieve/util.c
index 264030797..ab19525b8 100644
--- a/libsieve/util.c
+++ b/libsieve/util.c
@@ -159,6 +159,7 @@ sieve_value_create (sieve_data_type type, void *data)
case SVT_VALUE_LIST:
case SVT_STRING_LIST:
val->v.list = data;
+ break;
case SVT_TAG:
case SVT_IDENT:
@@ -201,13 +202,35 @@ void
sieve_error (sieve_machine_t mach, const char *fmt, ...)
{
va_list ap;
-
+
va_start (ap, fmt);
- mach->error_printer (mach->data, fmt, ap);
+ if (mach->identifier)
+ {
+ char *new_fmt = malloc (strlen (mach->identifier) + 2 +
+ strlen (fmt) + 1);
+ if (new_fmt)
+ {
+ strcpy (new_fmt, mach->identifier);
+ strcat (new_fmt, ": ");
+ strcat (new_fmt, fmt);
+ mach->error_printer (mach->data, new_fmt, ap);
+ free (new_fmt);
+ }
+ else
+ mach->error_printer (mach->data, fmt, ap);
+ }
+ else
+ mach->error_printer (mach->data, fmt, ap);
va_end (ap);
}
void
+sieve_arg_error (sieve_machine_t mach, int n)
+{
+ sieve_error (mach, _("cannot retrieve argument %d"), n);
+}
+
+void
sieve_debug_internal (sieve_printf_t printer, void *data, const char *fmt, ...)
{
va_list ap;

Return to:

Send suggestions and report system problems to the System administrator.