diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-06-26 19:36:37 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2007-06-26 19:36:37 +0000 |
commit | 8e183b755dac4b335859e2747a083ae6c178daf4 (patch) | |
tree | 1425d78bc3ad499fe3e1dbb74a749b4129822c11 /libsieve | |
parent | 945de1f1dc5207c2ff701ce590206fd8ba0de293 (diff) | |
download | mailutils-8e183b755dac4b335859e2747a083ae6c178daf4.tar.gz mailutils-8e183b755dac4b335859e2747a083ae6c178daf4.tar.bz2 |
New option --clearpath
Diffstat (limited to 'libsieve')
-rw-r--r-- | libsieve/argp.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/libsieve/argp.c b/libsieve/argp.c index 81a470a50..a610201ae 100644 --- a/libsieve/argp.c +++ b/libsieve/argp.c @@ -28,12 +28,16 @@ mu_list_t mu_sieve_library_path = NULL; static error_t sieve_argp_parser (int key, char *arg, struct argp_state *state); +#define CLEARPATH_OPTION 256 + /* Options used by programs that use extended authentication mechanisms. */ static struct argp_option sieve_argp_option[] = { { "includedir", 'I', N_("DIR"), 0, N_("Append directory DIR to the list of directories searched for include files"), 0 }, { "libdir", 'L', N_("DIR"), 0, N_("Append directory DIR to the list of directories searched for library files"), 0 }, + { "clearpath", CLEARPATH_OPTION, NULL, 0, + N_("Clear Sieve load path"), 0 }, { NULL, 0, NULL, 0, NULL, 0 } }; @@ -49,6 +53,12 @@ static struct argp_child sieve_argp_child = { 0 }; +static void +destroy_string (void *str) +{ + free (str); +} + static error_t sieve_argp_parser (int key, char *arg, struct argp_state *state) { @@ -64,6 +74,10 @@ sieve_argp_parser (int key, char *arg, struct argp_state *state) plist = &mu_sieve_library_path; break; + case CLEARPATH_OPTION: + mu_list_destroy (&mu_sieve_library_path); + break; + case ARGP_KEY_INIT: #ifdef SIEVE_MODDIR plist = &mu_sieve_library_path; @@ -87,9 +101,10 @@ sieve_argp_parser (int key, char *arg, struct argp_state *state) if (rc) { argp_error (state, "can't create list: %s", - mu_strerror (rc)); + mu_strerror (rc)); exit (1); } + mu_list_set_destroy_item (plist, destroy_string); } mu_list_append (*plist, strdup (arg)); } |