diff -urNp -x '*.orig' mutt-2.0.6.org/Makefile.am mutt-2.0.6/Makefile.am --- mutt-2.0.6.org/Makefile.am 2021-03-06 20:06:37.000000000 +0100 +++ mutt-2.0.6/Makefile.am 2021-04-18 19:23:38.363346256 +0200 @@ -36,7 +36,7 @@ mutt_SOURCES = \ main.c mbox.c menu.c mh.c mx.c pager.c parse.c pattern.c \ postpone.c query.c recvattach.c recvcmd.c \ rfc822.c rfc1524.c rfc2047.c rfc2231.c rfc3676.c \ - score.c send.c sendlib.c signal.c sort.c \ + score.c send.c sendlib.c signal.c signature.c sort.c \ status.c system.c thread.c charset.c history.c lib.c \ mutt_lisp.c muttlib.c editmsg.c mbyte.c \ url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c \ diff -urNp -x '*.orig' mutt-2.0.6.org/OPS mutt-2.0.6/OPS --- mutt-2.0.6.org/OPS 2021-03-06 20:06:37.000000000 +0100 +++ mutt-2.0.6/OPS 2021-04-18 19:23:38.363346256 +0200 @@ -213,6 +213,11 @@ */ OP_COMPOSE_EDIT_TO N_("edit the TO list") +/* L10N: Help screen description for OP_COMPOSE_SIG + compose menu: + */ +OP_COMPOSE_SIG N_("choose a signature") + /* L10N: Help screen description for OP_CREATE_MAILBOX browser menu: */ @@ -907,6 +912,12 @@ */ OP_NEXT_PAGE N_("move to the next page") +/* L10N: Help screen description for OP_NEXT_SIG + generic menu: + pager menu: + */ +OP_NEXT_SIG N_("move to the next signature") + /* L10N: Help screen description for OP_PAGER_BOTTOM pager menu: */ @@ -958,6 +969,12 @@ */ OP_PREV_PAGE N_("move to the previous page") +/* L10N: Help screen description for OP_PREV_SIG + generic menu: + pager menu: + */ +OP_PREV_SIG N_("move to the previous signature") + /* L10N: Help screen description for OP_PRINT index menu: pager menu: @@ -1006,6 +1006,12 @@ */ OP_QUIT N_("save changes to mailbox and quit") +/* L10N: Help screen description for OP_RANDOM_SIG + index menu: + pager menu: +*/ +OP_RANDOM_SIG N_("use random signature") + /* L10N: Help screen description for OP_RECALL_MESSAGE index menu: pager menu: @@ -1055,6 +1072,12 @@ */ OP_SEARCH_OPPOSITE N_("search for next match in opposite direction") +/* L10N: Help screen description for OP_SIG_SEARCH + generic menu: + pager menu: + */ +OP_SIG_SEARCH N_("search signatures matching a pattern") + /* L10N: Help screen description for OP_SEARCH_TOGGLE pager menu: */ diff -urNp -x '*.orig' mutt-2.0.6.org/PATCHES mutt-2.0.6/PATCHES --- mutt-2.0.6.org/PATCHES 2021-04-18 19:23:38.230011162 +0200 +++ mutt-2.0.6/PATCHES 2021-04-18 19:23:38.366679633 +0200 @@ -1 +1,2 @@ vvv.quote +patch-1.3.27.cd.signatures_menu.2.1 diff -urNp -x '*.orig' mutt-2.0.6.org/compose.c mutt-2.0.6/compose.c --- mutt-2.0.6.org/compose.c 2020-12-01 04:05:21.000000000 +0100 +++ mutt-2.0.6/compose.c 2021-04-18 19:23:38.363346256 +0200 @@ -1747,6 +1747,11 @@ int mutt_compose_menu (SEND_CONTEXT *sct /* no send2hook, since this doesn't modify the message */ break; + case OP_COMPOSE_SIG: + mutt_signature(msg->content->filename); + mutt_update_encoding (msg->content); + break; + case OP_PIPE: case OP_FILTER: CHECK_COUNT; diff -urNp -x '*.orig' mutt-2.0.6.org/doc/manual.xml.head mutt-2.0.6/doc/manual.xml.head --- mutt-2.0.6.org/doc/manual.xml.head 2021-03-06 20:06:37.000000000 +0100 +++ mutt-2.0.6/doc/manual.xml.head 2021-04-18 19:23:38.363346256 +0200 @@ -525,6 +525,7 @@ linkend="tab-keys-nav-page"/> for page-b +ESC s signature-menu select a signature and append it to your mail diff -urNp -x '*.orig' mutt-2.0.6.org/functions.h mutt-2.0.6/functions.h --- mutt-2.0.6.org/functions.h 2021-03-06 20:06:37.000000000 +0100 +++ mutt-2.0.6/functions.h 2021-04-18 19:23:38.363346256 +0200 @@ -308,6 +308,7 @@ const struct binding_t OpPager[] = { /* { "what-key", OP_WHAT_KEY, NULL }, { "check-stats", OP_CHECK_STATS, NULL }, + { "signature-menu", OP_COMPOSE_SIG, "\033s" }, #ifdef USE_SIDEBAR { "sidebar-first", OP_SIDEBAR_FIRST, NULL }, @@ -458,6 +459,19 @@ const struct binding_t OpQuery[] = { /* { NULL, 0, NULL } }; +/* Signature Menu */ +struct binding_t OpSig[] = { + { "next-sig", OP_NEXT_SIG, "j" }, + { "previous-sig", OP_PREV_SIG, "k" }, + { "random-sig", OP_RANDOM_SIG, "r" }, + { NULL, 0, NULL } +}; + +struct binding_t OpSigDir[] = { + { "search-sig", OP_SIG_SEARCH, "/" }, + { NULL, 0, NULL } +}; + const struct binding_t OpEditor[] = { /* map: editor */ { "bol", OP_EDITOR_BOL, "\001" }, { "backward-char", OP_EDITOR_BACKWARD_CHAR, "\002" }, diff -urNp -x '*.orig' mutt-2.0.6.org/globals.h mutt-2.0.6/globals.h --- mutt-2.0.6.org/globals.h 2021-04-18 19:23:38.230011162 +0200 +++ mutt-2.0.6/globals.h 2021-04-18 19:23:38.363346256 +0200 @@ -145,6 +145,7 @@ WHERE char *SidebarFormat; WHERE char *SidebarIndentString; #endif WHERE char *Signature; +WHERE char *SigDirectory; WHERE char *SimpleSearch; #if USE_SMTP WHERE char *SmtpAuthenticators; diff -urNp -x '*.orig' mutt-2.0.6.org/init.h mutt-2.0.6/init.h --- mutt-2.0.6.org/init.h 2021-04-18 19:23:38.230011162 +0200 +++ mutt-2.0.6/init.h 2021-04-18 19:23:38.363346256 +0200 @@ -1953,6 +1953,14 @@ struct option_t MuttVars[] = { ** automatically generated with \fIa\fP will be composed ** from this prefix and the letter \fIa\fP. */ + { "signatures_directory", DT_PATH, R_NONE, {.p=&SigDirectory}, {.p=""} }, + /* + ** .pp + ** Specifies the path where your signatures are located. In the files of + ** this directory, the signatures are separated by blank lines and/or + ** sig_dashes (``-- ''). + ** You can choose between these signatures from the compose menu. + */ { "mark_old", DT_BOOL, R_BOTH, {.l=OPTMARKOLD}, {.l=1} }, /* ** .pp diff -urNp -x '*.orig' mutt-2.0.6.org/keymap.c mutt-2.0.6/keymap.c --- mutt-2.0.6.org/keymap.c 2021-03-06 20:06:37.000000000 +0100 +++ mutt-2.0.6/keymap.c 2021-04-18 19:23:38.366679633 +0200 @@ -49,6 +49,8 @@ const struct mapping_t Menus[] = { { "pager", MENU_PAGER }, { "postpone", MENU_POST }, { "pgp", MENU_PGP }, + { "signature", MENU_SIG }, + { "sig_directory", MENU_SIG_DIR }, { "smime", MENU_SMIME }, #ifdef CRYPT_BACKEND_GPGME { "key_select_pgp", MENU_KEY_SELECT_PGP }, @@ -749,6 +751,8 @@ void km_init (void) create_bindings (OpPost, MENU_POST); create_bindings (OpQuery, MENU_QUERY); create_bindings (OpAlias, MENU_ALIAS); + create_bindings (OpSig, MENU_SIG); + create_bindings (OpSigDir, MENU_SIG_DIR); if ((WithCrypto & APPLICATION_PGP)) @@ -851,6 +855,9 @@ void km_init (void) km_bindkey ("", MENU_ATTACH, OP_VIEW_ATTACH); km_bindkey ("", MENU_COMPOSE, OP_VIEW_ATTACH); + km_bindkey ("", MENU_SIG, OP_PREV_SIG); + km_bindkey ("", MENU_SIG, OP_NEXT_SIG); + /* edit-to (default "t") hides generic tag-entry in Compose menu This will bind tag-entry to "T" in the Compose menu */ km_bindkey ("T", MENU_COMPOSE, OP_TAG); @@ -1015,6 +1022,10 @@ const struct binding_t *km_get_table (in return OpQuery; case MENU_LIST: return OpList; + case MENU_SIG: + return OpSig; + case MENU_SIG_DIR: + return OpSigDir; case MENU_PGP: return (WithCrypto & APPLICATION_PGP)? OpPgp:NULL; diff -urNp -x '*.orig' mutt-2.0.6.org/keymap.h mutt-2.0.6/keymap.h --- mutt-2.0.6.org/keymap.h 2021-03-06 20:06:37.000000000 +0100 +++ mutt-2.0.6/keymap.h 2021-04-18 19:23:38.366679633 +0200 @@ -63,6 +63,8 @@ enum MENU_PAGER, MENU_POST, MENU_QUERY, + MENU_SIG, + MENU_SIG_DIR, MENU_PGP, @@ -105,6 +107,8 @@ const struct binding_t *km_get_table (in extern const struct binding_t OpGeneric[]; extern const struct binding_t OpPost[]; extern const struct binding_t OpMain[]; +extern struct binding_t OpSig[]; +extern struct binding_t OpSigDir[]; extern const struct binding_t OpAttach[]; extern const struct binding_t OpPager[]; extern const struct binding_t OpCompose[]; diff -urNp -x '*.orig' mutt-2.0.6.org/menu.c mutt-2.0.6/menu.c --- mutt-2.0.6.org/menu.c 2021-04-18 19:23:38.230011162 +0200 +++ mutt-2.0.6/menu.c 2021-04-18 19:23:38.366679633 +0200 @@ -683,7 +683,7 @@ void menu_current_bottom (MUTTMENU *menu mutt_error _("No entries."); } -static void menu_next_entry (MUTTMENU *menu) +void menu_next_entry (MUTTMENU *menu) { if (menu->current < menu->max - 1) { @@ -694,7 +694,7 @@ static void menu_next_entry (MUTTMENU *m mutt_error _("You are on the last entry."); } -static void menu_prev_entry (MUTTMENU *menu) +void menu_prev_entry (MUTTMENU *menu) { if (menu->current) { diff -urNp -x '*.orig' mutt-2.0.6.org/protos.h mutt-2.0.6/protos.h --- mutt-2.0.6.org/protos.h 2021-03-06 20:06:37.000000000 +0100 +++ mutt-2.0.6/protos.h 2021-04-18 19:23:38.366679633 +0200 @@ -224,6 +224,7 @@ void mutt_free_body (BODY **); void mutt_free_body (BODY **); void mutt_free_enter_state (ENTER_STATE **); void mutt_free_envelope (ENVELOPE **); +void mutt_signature (char *); void mutt_free_header (HEADER **); void mutt_free_parameter (PARAMETER **); void mutt_free_regexp (REGEXP **); diff -urNp -x '*.orig' mutt-2.0.6.org/signature.c mutt-2.0.6/signature.c --- mutt-2.0.6.org/signature.c 1970-01-01 01:00:00.000000000 +0100 +++ mutt-2.0.6/signature.c 2021-04-18 19:23:38.366679633 +0200 @@ -0,0 +1,499 @@ +/* + * Copyright (C) 2001 Cedric Duval + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + */ + +#if HAVE_CONFIG_H +# include "config.h" +#endif + +#include "mutt.h" +#include "mutt_menu.h" +#include "mapping.h" +#include "mutt_curses.h" + +#include +#include +#include +#include +#include + +#define SIG_DISPLAY_LINES 4 +#define SEPARATOR(x) ((*x == '\n') || (mutt_strcmp (x, "-- \n") == 0)) +#define SIG_ADD_LINE(x,y) mutt_add_list (x, strtok (y, "\n")) + +typedef struct sig_list +{ + struct sig_list *next; + LIST *sig; +} SIG_LIST; + +typedef struct sig_dir +{ + struct sig_dir *next; + char *name; +} SIG_DIR; + +typedef LIST * ENTRY; + +typedef struct entry_dir +{ + int tagged; + SIG_DIR *data; +} ENTRY_DIR; + +static struct mapping_t SigHelp[] = { + { N_("Exit"), OP_EXIT }, + { N_("Search"), OP_SEARCH }, + { N_("Random"), OP_RANDOM_SIG }, + { N_("Help"), OP_HELP }, + { NULL } +}; + +static struct mapping_t SigDirHelp[] = { + { N_("Exit"), OP_EXIT }, + { N_("Search signature"), OP_SIG_SEARCH }, + { N_("Help"), OP_HELP }, + { NULL } +}; + +void menu_next_entry (MUTTMENU *menu); +void menu_prev_entry (MUTTMENU *menu); + + +static int sig_match (LIST *s, regex_t *re) +{ + while (s) + { + if (regexec (re, s->data, (size_t)0, NULL, (int)0) == 0) + return 1; + s = s->next; + } + return 0; +} + +static void read_sig_file (char *name, SIG_LIST **begin, regex_t *re) +{ + FILE *fp; + char buf[STRING]; + LIST *sig = NULL; + SIG_LIST *first, *cur; + int append = 0; + + if (!(fp = safe_fopen (name, "r"))) + { + mutt_error (_("Can't open signature file %s"), name); + return; + } + + for (first = *begin; first && first->next; first = first->next, append++) + ; /* append results to an existing list */ + cur = first; + + while (fgets (buf, sizeof (buf), fp)) + { + if (buf[0] && !SEPARATOR (buf)) + { + sig = SIG_ADD_LINE (NULL, buf); + + while (fgets (buf, sizeof (buf), fp) && buf[0] && !SEPARATOR (buf)) + SIG_ADD_LINE (sig, buf); + + if (re && !sig_match (sig, re)) + mutt_free_list (&sig); /* previous sig didn't match the regexp */ + else + { + /* add signature */ + if (first == NULL) + first = cur = (SIG_LIST *) safe_calloc (1, sizeof (SIG_LIST)); + else + { + cur->next = (SIG_LIST *) safe_calloc (1, sizeof (SIG_LIST)); + cur = cur->next; + } + + cur->sig = sig; + cur->next = NULL; + } + } + } + + if (!append) + *begin = first; + + safe_fclose (&fp); +} + +static void sig_make_entry (char *s, size_t slen, MUTTMENU *menu, int num) +{ + ENTRY *table = (ENTRY *) menu->data; + + snprintf (s, slen, "%3d %s", + num + 1, + table[num]->data); +} + +static int sig_menu_search (MUTTMENU *menu, regex_t *re, int num) +{ + return (sig_match (((ENTRY *)menu->data)[num], re) ? 0 : REG_NOMATCH); +} + +static void draw_sig_frame (LIST *s) +{ + int i; + + for (i = 1; i <= SIG_DISPLAY_LINES; i++) + { + if (s) + { + mvaddstr (i, 0, s->data); + s = s->next; + } + else + move (i, 0); + + clrtoeol (); + } + + SETCOLOR (MT_COLOR_STATUS); + mvaddstr (SIG_DISPLAY_LINES + 1, 0, _("-- Signature")); + SETCOLOR (MT_COLOR_STATUS); + clrtoeol (); + + NORMAL_COLOR; +} + +static void free_sig_list (SIG_LIST **sigs) +{ + SIG_LIST *cur; + + while (*sigs) + { + cur = *sigs; + *sigs = (*sigs)->next; + mutt_free_list (&cur->sig); + safe_free ((void **)&cur); + } +} + +static void append_signature (char *msg_file, LIST *s) +{ + FILE *fp; + + if ((fp = safe_fopen (msg_file, "a")) == 0) + mutt_perror (msg_file); + else + { + if (option (OPTSIGDASHES)) + fputs ("\n-- \n", fp); + + for (; s; s = s->next) + fprintf (fp, "%s\n", s->data); + + mutt_message (_("Signature appended to your mail")); + safe_fclose (&fp); + } +} + +static LIST *sig_list_menu (char *file, SIG_LIST *list) +{ + LIST *result = NULL; + SIG_LIST *sigl; + MUTTMENU *menu; + ENTRY *SigTable; + char helpstr[SHORT_STRING], title[SHORT_STRING]; + int i, done = 0; + + snprintf (title, sizeof (title), _("Signature : %s"), file); + + menu = mutt_new_menu (MENU_SIG); + menu->make_entry = sig_make_entry; + menu->tag = NULL; + menu->search = sig_menu_search; + menu->title = title; + menu->help = mutt_compile_help (helpstr, sizeof (helpstr), + MENU_SIG, SigHelp); + menu->offset = SIG_DISPLAY_LINES + 2; + menu->pagelen = LINES - SIG_DISPLAY_LINES - 4; + + for (sigl = list; sigl; sigl = sigl->next) + menu->max++; + + menu->data = SigTable = (ENTRY *) safe_calloc (menu->max, sizeof (ENTRY)); + + for (i = 0, sigl = list; sigl; i++, sigl = sigl->next) + SigTable[i] = sigl->sig; + + while (!done) + { + switch (mutt_menuLoop (menu)) + { + case OP_GENERIC_SELECT_ENTRY: + result = SigTable[menu->current]; + done = 1; + break; + + case OP_PREV_SIG: + menu_prev_entry (menu); + draw_sig_frame (SigTable[menu->current]); + break; + + case OP_NEXT_SIG: + menu_next_entry (menu); + draw_sig_frame (SigTable[menu->current]); + break; + + case OP_REDRAW: + menu->offset = SIG_DISPLAY_LINES + 2; + menu->pagelen = LINES - SIG_DISPLAY_LINES - 4; + draw_sig_frame (SigTable[menu->current]); + break; + + case OP_RANDOM_SIG: + menu->current = LRAND () % menu->max; + draw_sig_frame (SigTable[menu->current]); + menu->redraw |= REDRAW_MOTION; + break; + + case OP_EXIT: + done = 1; + break; + } + } + + mutt_menuDestroy (&menu); + safe_free ((void **)&SigTable); + return result; +} + +extern char* SearchBuffers[MENU_MAX]; + +static SIG_LIST *sig_search_filter (MUTTMENU *menu, char *path) +{ + regex_t re; + char buf[STRING]; + SIG_LIST *result = NULL; + int i; + char* searchBuf = menu->menu >= 0 && menu->menu < MENU_MAX ? + SearchBuffers[menu->menu] : NULL; + + snprintf (buf, sizeof(buf), searchBuf ? searchBuf : ""); + if (mutt_get_field (_("Search for: "), buf, + sizeof (buf), MUTT_CLEAR) != 0 || !buf[0]) + return (NULL); + if (menu->menu >= 0 && menu->menu < MENU_MAX) + { + mutt_str_replace (&SearchBuffers[menu->menu], buf); + searchBuf = SearchBuffers[menu->menu]; + } + + if ((i = regcomp (&re, searchBuf, REG_NOSUB | REG_EXTENDED | REG_WORDS + | mutt_which_case (searchBuf))) != 0) + { + regerror (i, &re, buf, sizeof (buf)); + regfree (&re); + mutt_error ("%s", buf); + return (NULL); + } + + /* building list of sigs matching the regexp */ + for (i = 0; i < menu->max; i++) + { + /* search in every file if none is tagged */ + if (((ENTRY_DIR *) menu->data)[i].tagged || (menu->tagged == 0)) + { + snprintf (buf, sizeof (buf), "%s/%s", path, + ((ENTRY_DIR *) menu->data)[i].data->name); + read_sig_file (buf, &result, &re); + } + } + + regfree (&re); + if (!result) + mutt_error (_("Not found.")); + + return (result); +} + +/* returns the list of files in this directory */ +static SIG_DIR *sig_directory (char *path) +{ + DIR *dp; + struct dirent *de; + struct stat s; + SIG_DIR *first = NULL, *cur = NULL; + char file[_POSIX_PATH_MAX + SHORT_STRING]; + + if ((dp = opendir (path)) == NULL) + { + mutt_perror (path); + return (NULL); + } + + while ((de = readdir (dp))) + { + if ((de->d_name)[0] == '.') /* no hidden files */ + continue; + + snprintf (file, sizeof (file), "%s/%s", path, de->d_name); + if (lstat (file, &s) == -1) + continue; + + if ((!S_ISREG (s.st_mode)) && (!S_ISLNK (s.st_mode))) + continue; + + if (first == NULL) + cur = first = safe_calloc (1, sizeof (SIG_DIR)); + else + { + cur->next = safe_calloc (1, sizeof (SIG_DIR)); + cur = cur->next; + } + cur->name = safe_strdup (de->d_name); + cur->next = NULL; + } + closedir (dp); + return first; +} + +static void sig_dir_make_entry (char *s, size_t slen, MUTTMENU *menu, int num) +{ + ENTRY_DIR *table = (ENTRY_DIR *) menu->data; + + snprintf (s, slen, "%c %3d - %s", + table[num].tagged ? '*' : ' ', + num + 1, + table[num].data->name); +} + +static int sig_dir_tag (MUTTMENU *menu, int n, int m) +{ + ENTRY_DIR *cur = &((ENTRY_DIR *) menu->data)[n]; + int ot = cur->tagged; + + cur->tagged = m >= 0 ? m : !cur->tagged; + return cur->tagged - ot; + +} + +static int sig_dir_sort (const void *a, const void *b) +{ + ENTRY_DIR *pa = (ENTRY_DIR *) a; + ENTRY_DIR *pb = (ENTRY_DIR *) b; + + return (mutt_strcmp (pa->data->name, pb->data->name)); +} + +static int sig_dir_menu (char *path, char *msg_file) +{ + MUTTMENU *menu; + SIG_LIST *sigl; + LIST *result = NULL; + ENTRY_DIR *FileTable; + SIG_DIR *list, *files; + char buf[STRING], helpstr[SHORT_STRING], title[SHORT_STRING]; + int i, done = 0; + + if ((list = sig_directory (path)) == NULL) + return -1; + + snprintf (title, sizeof (title), "Signature directory : %s", path); + + menu = mutt_new_menu (MENU_SIG_DIR); + menu->make_entry = sig_dir_make_entry; + menu->search = NULL; /* search within files with sig_search_filter() */ + menu->tag = sig_dir_tag; + menu->title = title; + menu->help = mutt_compile_help (helpstr, sizeof (helpstr), + MENU_SIG_DIR, SigDirHelp); + + for (files = list; files; files = files->next) + menu->max++; + + menu->data = FileTable = (ENTRY_DIR *) safe_calloc (menu->max, + sizeof (ENTRY_DIR)); + + for (i = 0, files = list; files; i++, files = files->next) + FileTable[i].data = files; + + qsort (FileTable, menu->max, sizeof (ENTRY_DIR), sig_dir_sort); + + while (!done) + { + switch (mutt_menuLoop (menu)) + { + case OP_SIG_SEARCH: + sigl = sig_search_filter (menu, path); + + if (sigl) + { + if ((result = sig_list_menu (_("query results"), sigl)) != NULL) + { + append_signature (msg_file, result); + done = 1; + } + + free_sig_list (&sigl); + } + break; + + case OP_GENERIC_SELECT_ENTRY: + snprintf (buf, sizeof (buf), "%s/%s", path, + FileTable[menu->current].data->name); + sigl = NULL; + read_sig_file (buf, &sigl, NULL); + + if (sigl) + { + if ((result = sig_list_menu (buf, sigl)) != NULL) + { + append_signature (msg_file, result); + done = 1; + } + + free_sig_list (&sigl); + } + break; + + case OP_EXIT: + done = 1; + break; + } + } + + while (list) + { + safe_free ((void **)&list->name); + files = list; + list = list->next; + safe_free ((void **)&files); + } + safe_free ((void **)&FileTable); + mutt_menuDestroy (&menu); + return 0; +} + +void mutt_signature (char *msg_file) +{ + if (!SigDirectory) + { + mutt_error (_("variable 'signatures_directory' is unset")); + return; + } + + if (sig_dir_menu (SigDirectory, msg_file) == -1) + mutt_error (_("%s: no files in this directory"), SigDirectory); +}