X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=alias.c;h=8d48a78305fcd6ff678997e0e1c5102ac038d646;hp=81285874a2b89ae8327cdd8c6bf0fa13f69de368;hb=3c94b38b2555a98b4a7f3d9d9e1ac4aadc830edf;hpb=0d52617ab7fc6b2d78b5835ad5230edaf5aafa4f diff --git a/alias.c b/alias.c index 8128587..8d48a78 100644 --- a/alias.c +++ b/alias.c @@ -25,21 +25,7 @@ * please see the file GPL in the top level source directory. */ -#if HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include +#include #include @@ -47,6 +33,7 @@ #include #include +#include "alias.h" #include "mutt_idna.h" #include "sort.h" @@ -66,6 +53,8 @@ static struct mapping_t AliasHelp[] = { {NULL, OP_NULL} }; +static void mutt_alias_menu(char *, size_t, alias_t *); + const address_t *alias_lookup(const char *s) { alias_t *list; @@ -251,7 +240,7 @@ void mutt_create_alias(ENVELOPE *cur, address_t *iadr) mutt_addrlist_to_idna(adr, NULL); do { - const char *err = NULL; + char *err = NULL; if (mutt_get_field(_("Address: "), buf, sizeof(buf), 0) || !buf[0]) { alias_list_wipe(&new); @@ -264,6 +253,7 @@ void mutt_create_alias(ENVELOPE *cur, address_t *iadr) if (mutt_addrlist_to_idna(new->addr, &err)) { mutt_error(_("Error: '%s' is a bad IDN."), err); + p_delete(&err); mutt_sleep(1); continue; } @@ -310,7 +300,7 @@ void mutt_create_alias(ENVELOPE *cur, address_t *iadr) buf[0] = '\0'; rfc822_write_address(buf, sizeof(buf), new->addr, 0); write_safe_address(rc, buf); - fclose(rc); + m_fclose(&rc); mutt_message _("Alias added."); } else { mutt_perror(buf); @@ -365,9 +355,7 @@ static address_t *mutt_expand_aliases_r(address_t *a, string_list_t **expn) if (option(OPTUSEDOMAIN)) { /* now qualify all local addresses */ - const char *fqdn = mutt_fqdn(1); - if (fqdn) - rfc822_qualify(head, fqdn); + rfc822_qualify(head, mutt_fqdn(1)); } return head; @@ -380,7 +368,8 @@ address_t *mutt_expand_aliases(address_t *a) t = mutt_expand_aliases_r(a, &expn); string_list_wipe(&expn); - return mutt_remove_duplicates(t); + address_list_uniq(t); + return t; } void mutt_expand_aliases_env(ENVELOPE *env)