summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2008-01-14 10:20:34 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2008-01-14 10:20:34 +0000
commit1413c3ce86580156df4b68941eb2a1f77eeab7be (patch)
tree3527bafcf6ed8de8ae4a492d12ee21471605be32
parenta68e43adf5e389f3dfe874eb036b6dadda1393dd (diff)
downloadmailutils-1413c3ce86580156df4b68941eb2a1f77eeab7be.tar.gz
mailutils-1413c3ce86580156df4b68941eb2a1f77eeab7be.tar.bz2
* libsieve/conf.c (mu_sieve_module_init): Remove initial call to
_path_append. * libsieve/load.c (sieve_init_load_path): New function. (load_module,sieve_load_add_path,sieve_load_add_dir): Call sieve_init_load_path. * mail.local/main.c (parse_opt): Bugfix. Translate -S option to sieve-filter configuration statement.
-rw-r--r--ChangeLog10
-rw-r--r--libsieve/conf.c6
-rw-r--r--libsieve/load.c28
-rw-r--r--mail.local/main.c3
4 files changed, 36 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index dc260b8f5..cd1404743 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-01-14 Sergey Poznyakoff <gray@gnu.org.ua>
+
+ * libsieve/conf.c (mu_sieve_module_init): Remove initial call to
+ _path_append.
+ * libsieve/load.c (sieve_init_load_path): New function.
+ (load_module,sieve_load_add_path,sieve_load_add_dir): Call
+ sieve_init_load_path.
+ * mail.local/main.c (parse_opt): Bugfix. Translate -S option to
+ sieve-filter configuration statement.
+
2008-01-13 Sergey Poznyakoff <gray@gnu.org.ua>
Fix NLS issues.
diff --git a/libsieve/conf.c b/libsieve/conf.c
index 6819337d5..596eac9bb 100644
--- a/libsieve/conf.c
+++ b/libsieve/conf.c
@@ -1,6 +1,6 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002, 2005,
- 2007 Free Software Foundation, Inc.
+ 2007, 2008 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -57,10 +57,6 @@ mu_sieve_module_init (void *data)
return 0;
p = data;
-#ifdef SIEVE_MODDIR
- _path_append (SIEVE_MODDIR, &mu_sieve_library_path);
-#endif
-
if (p->clearflags & MU_SIEVE_CLEAR_INCLUDE_PATH)
mu_list_destroy (&mu_sieve_include_path);
mu_list_do (p->include_path, _path_append, &mu_sieve_include_path);
diff --git a/libsieve/load.c b/libsieve/load.c
index 6922bc648..31148b855 100644
--- a/libsieve/load.c
+++ b/libsieve/load.c
@@ -1,6 +1,6 @@
/* GNU Mailutils -- a suite of utilities for electronic mail
Copyright (C) 1999, 2000, 2001, 2002, 2005,
- 2007 Free Software Foundation, Inc.
+ 2007, 2008 Free Software Foundation, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -42,12 +42,30 @@ _free_loaded_module (void *data)
}
#endif
+static int
+sieve_init_load_path ()
+{
+ static int inited = 0;
+
+ if (!inited)
+ {
+ if (lt_dlinit ())
+ return 1;
+#ifdef SIEVE_MODDIR
+ _add_load_dir (SIEVE_MODDIR, NULL);
+ inited = 1;
+#endif
+ }
+ return 0;
+}
+
+
static lt_dlhandle
load_module (mu_sieve_machine_t mach, const char *name)
{
lt_dlhandle handle;
- if (lt_dlinit ())
+ if (sieve_init_load_path ())
return NULL;
handle = lt_dlopenext (name);
@@ -76,7 +94,7 @@ load_module (mu_sieve_machine_t mach, const char *name)
if (!handle)
{
- mu_sieve_error (mach, "%s", lt_dlerror ());
+ mu_sieve_error (mach, "%s: %s", name, lt_dlerror ());
lt_dlexit ();
}
return handle;
@@ -117,7 +135,7 @@ _add_load_dir (void *item, void *unused)
int
sieve_load_add_path (mu_list_t path)
{
- if (lt_dlinit ())
+ if (sieve_init_load_path ())
return 1;
return mu_list_do (path, _add_load_dir, NULL);
}
@@ -125,7 +143,7 @@ sieve_load_add_path (mu_list_t path)
int
sieve_load_add_dir (mu_sieve_machine_t mach, const char *name)
{
- if (lt_dlinit ())
+ if (sieve_init_load_path ())
return 1;
mu_sieve_machine_add_destructor (mach, (mu_sieve_destructor_t) lt_dlexit, NULL);
return lt_dladdsearchdir (name);
diff --git a/mail.local/main.c b/mail.local/main.c
index a7ff2c0d5..72dfb924e 100644
--- a/mail.local/main.c
+++ b/mail.local/main.c
@@ -222,7 +222,8 @@ parse_opt (int key, char *arg, struct argp_state *state)
#endif
case 'S':
- mu_argp_node_list_new (&lst, "sieve", arg);
+ mu_argp_node_list_new (&lst, "sieve-filter", arg);
+
break;
case 'x':

Return to:

Send suggestions and report system problems to the System administrator.