Commit 1413c3ce 1413c3ce86580156df4b68941eb2a1f77eeab7be by Sergey Poznyakoff

* 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.
1 parent a68e43ad
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.
......
/* 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);
......
/* 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);
......
......@@ -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':
......