* 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.
Showing
4 changed files
with
36 additions
and
11 deletions
1 | 2008-01-14 Sergey Poznyakoff <gray@gnu.org.ua> | ||
2 | |||
3 | * libsieve/conf.c (mu_sieve_module_init): Remove initial call to | ||
4 | _path_append. | ||
5 | * libsieve/load.c (sieve_init_load_path): New function. | ||
6 | (load_module,sieve_load_add_path,sieve_load_add_dir): Call | ||
7 | sieve_init_load_path. | ||
8 | * mail.local/main.c (parse_opt): Bugfix. Translate -S option to | ||
9 | sieve-filter configuration statement. | ||
10 | |||
1 | 2008-01-13 Sergey Poznyakoff <gray@gnu.org.ua> | 11 | 2008-01-13 Sergey Poznyakoff <gray@gnu.org.ua> |
2 | 12 | ||
3 | Fix NLS issues. | 13 | Fix NLS issues. | ... | ... |
1 | /* GNU Mailutils -- a suite of utilities for electronic mail | 1 | /* GNU Mailutils -- a suite of utilities for electronic mail |
2 | Copyright (C) 1999, 2000, 2001, 2002, 2005, | 2 | Copyright (C) 1999, 2000, 2001, 2002, 2005, |
3 | 2007 Free Software Foundation, Inc. | 3 | 2007, 2008 Free Software Foundation, Inc. |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Lesser General Public | 6 | modify it under the terms of the GNU Lesser General Public |
... | @@ -57,10 +57,6 @@ mu_sieve_module_init (void *data) | ... | @@ -57,10 +57,6 @@ mu_sieve_module_init (void *data) |
57 | return 0; | 57 | return 0; |
58 | p = data; | 58 | p = data; |
59 | 59 | ||
60 | #ifdef SIEVE_MODDIR | ||
61 | _path_append (SIEVE_MODDIR, &mu_sieve_library_path); | ||
62 | #endif | ||
63 | |||
64 | if (p->clearflags & MU_SIEVE_CLEAR_INCLUDE_PATH) | 60 | if (p->clearflags & MU_SIEVE_CLEAR_INCLUDE_PATH) |
65 | mu_list_destroy (&mu_sieve_include_path); | 61 | mu_list_destroy (&mu_sieve_include_path); |
66 | mu_list_do (p->include_path, _path_append, &mu_sieve_include_path); | 62 | mu_list_do (p->include_path, _path_append, &mu_sieve_include_path); | ... | ... |
1 | /* GNU Mailutils -- a suite of utilities for electronic mail | 1 | /* GNU Mailutils -- a suite of utilities for electronic mail |
2 | Copyright (C) 1999, 2000, 2001, 2002, 2005, | 2 | Copyright (C) 1999, 2000, 2001, 2002, 2005, |
3 | 2007 Free Software Foundation, Inc. | 3 | 2007, 2008 Free Software Foundation, Inc. |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Lesser General Public | 6 | modify it under the terms of the GNU Lesser General Public |
... | @@ -42,12 +42,30 @@ _free_loaded_module (void *data) | ... | @@ -42,12 +42,30 @@ _free_loaded_module (void *data) |
42 | } | 42 | } |
43 | #endif | 43 | #endif |
44 | 44 | ||
45 | static int | ||
46 | sieve_init_load_path () | ||
47 | { | ||
48 | static int inited = 0; | ||
49 | |||
50 | if (!inited) | ||
51 | { | ||
52 | if (lt_dlinit ()) | ||
53 | return 1; | ||
54 | #ifdef SIEVE_MODDIR | ||
55 | _add_load_dir (SIEVE_MODDIR, NULL); | ||
56 | inited = 1; | ||
57 | #endif | ||
58 | } | ||
59 | return 0; | ||
60 | } | ||
61 | |||
62 | |||
45 | static lt_dlhandle | 63 | static lt_dlhandle |
46 | load_module (mu_sieve_machine_t mach, const char *name) | 64 | load_module (mu_sieve_machine_t mach, const char *name) |
47 | { | 65 | { |
48 | lt_dlhandle handle; | 66 | lt_dlhandle handle; |
49 | 67 | ||
50 | if (lt_dlinit ()) | 68 | if (sieve_init_load_path ()) |
51 | return NULL; | 69 | return NULL; |
52 | 70 | ||
53 | handle = lt_dlopenext (name); | 71 | handle = lt_dlopenext (name); |
... | @@ -76,7 +94,7 @@ load_module (mu_sieve_machine_t mach, const char *name) | ... | @@ -76,7 +94,7 @@ load_module (mu_sieve_machine_t mach, const char *name) |
76 | 94 | ||
77 | if (!handle) | 95 | if (!handle) |
78 | { | 96 | { |
79 | mu_sieve_error (mach, "%s", lt_dlerror ()); | 97 | mu_sieve_error (mach, "%s: %s", name, lt_dlerror ()); |
80 | lt_dlexit (); | 98 | lt_dlexit (); |
81 | } | 99 | } |
82 | return handle; | 100 | return handle; |
... | @@ -117,7 +135,7 @@ _add_load_dir (void *item, void *unused) | ... | @@ -117,7 +135,7 @@ _add_load_dir (void *item, void *unused) |
117 | int | 135 | int |
118 | sieve_load_add_path (mu_list_t path) | 136 | sieve_load_add_path (mu_list_t path) |
119 | { | 137 | { |
120 | if (lt_dlinit ()) | 138 | if (sieve_init_load_path ()) |
121 | return 1; | 139 | return 1; |
122 | return mu_list_do (path, _add_load_dir, NULL); | 140 | return mu_list_do (path, _add_load_dir, NULL); |
123 | } | 141 | } |
... | @@ -125,7 +143,7 @@ sieve_load_add_path (mu_list_t path) | ... | @@ -125,7 +143,7 @@ sieve_load_add_path (mu_list_t path) |
125 | int | 143 | int |
126 | sieve_load_add_dir (mu_sieve_machine_t mach, const char *name) | 144 | sieve_load_add_dir (mu_sieve_machine_t mach, const char *name) |
127 | { | 145 | { |
128 | if (lt_dlinit ()) | 146 | if (sieve_init_load_path ()) |
129 | return 1; | 147 | return 1; |
130 | mu_sieve_machine_add_destructor (mach, (mu_sieve_destructor_t) lt_dlexit, NULL); | 148 | mu_sieve_machine_add_destructor (mach, (mu_sieve_destructor_t) lt_dlexit, NULL); |
131 | return lt_dladdsearchdir (name); | 149 | return lt_dladdsearchdir (name); | ... | ... |
... | @@ -222,7 +222,8 @@ parse_opt (int key, char *arg, struct argp_state *state) | ... | @@ -222,7 +222,8 @@ parse_opt (int key, char *arg, struct argp_state *state) |
222 | #endif | 222 | #endif |
223 | 223 | ||
224 | case 'S': | 224 | case 'S': |
225 | mu_argp_node_list_new (&lst, "sieve", arg); | 225 | mu_argp_node_list_new (&lst, "sieve-filter", arg); |
226 | |||
226 | break; | 227 | break; |
227 | 228 | ||
228 | case 'x': | 229 | case 'x': | ... | ... |
-
Please register or sign in to post a comment