X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=alias.c;h=fa83c6fde50fad1494b431de6f9c52cee423a521;hb=d04295aaf918032c1c2fafc94ddf637cf23341e9;hp=aec85d624377e27ad52636b29d21cac7ac225262;hpb=c88f8ebd5e7542e4ee2ac2c24dfd5f358dbb4235;p=apps%2Fmadmutt.git diff --git a/alias.c b/alias.c index aec85d6..fa83c6f 100644 --- a/alias.c +++ b/alias.c @@ -20,15 +20,17 @@ #include #include #include +#include +#include -#include "lib/rx.h" -#include "lib/debug.h" +#include + +#include +#include +#include #include "mutt.h" -#include "enter.h" -#include "mutt_curses.h" #include "mutt_idna.h" -#include "mutt_menu.h" #include "sort.h" #define RSORT(x) (SortAlias & SORT_REVERSE) ? -x : x @@ -79,7 +81,7 @@ static address_t *mutt_expand_aliases_r (address_t * a, LIST ** expn) u->data = m_strdup(a->mailbox); u->next = *expn; *expn = u; - w = rfc822_cpy_adr (t); + w = address_list_dup (t); w = mutt_expand_aliases_r (w, expn); if (head) last->next = w; @@ -91,7 +93,7 @@ static address_t *mutt_expand_aliases_r (address_t * a, LIST ** expn) t = a; a = a->next; t->next = NULL; - rfc822_free_address (&t); + address_delete (&t); continue; } else { @@ -100,8 +102,8 @@ static address_t *mutt_expand_aliases_r (address_t * a, LIST ** expn) if (pw) { char namebuf[STRING]; - mutt_gecos_name (namebuf, sizeof (namebuf), pw); - str_replace (&a->personal, namebuf); + mutt_gecos_name(namebuf, sizeof (namebuf), pw, GecosMask.rx); + m_strreplace(&a->personal, namebuf); } } } @@ -404,12 +406,12 @@ int mutt_alias_complete (char *s, size_t buflen) #define min(a,b) ((aname && strstr (a->name, s) == a->name) { if (!bestname[0]) /* init */ - m_strcpy(bestname, MIN(m_strlen(a->name) + 1, sizeof(bestname)), + m_strcpy(bestname, MIN(m_strlen(a->name) + 1, ssizeof(bestname)), a->name); else { for (i = 0; a->name[i] && a->name[i] == bestname[i]; i++); @@ -541,19 +543,21 @@ int mutt_addr_is_user (address_t * addr) return 0; } -static const char *alias_format_str (char *dest, size_t destlen, char op, - const char *src, const char *fmt, - const char *ifstring, - const char *elsestring, - unsigned long data, format_flag flags) +static const format_t *alias_format_str (char *dest, size_t destlen, char op, + const format_t *src, const char *fmt, + const char *ifstring __attribute__ ((unused)), + const char *elsestring __attribute__ ((unused)), + unsigned long data, format_flag flags __attribute__ ((unused))) { char tmp[SHORT_STRING], adr[SHORT_STRING]; ALIAS *alias = (ALIAS *) data; switch (op) { case 'f': - snprintf (tmp, sizeof (tmp), "%%%ss", fmt); - snprintf (dest, destlen, tmp, alias->del ? "D" : " "); + if(alias->del) + m_strcpy (dest, sizeof(dest), "D"); + else + m_strcpy (dest, sizeof(dest), " "); break; case 'a': mutt_format_s (dest, destlen, fmt, alias->name); @@ -579,7 +583,7 @@ static const char *alias_format_str (char *dest, size_t destlen, char op, static void alias_entry (char *s, size_t slen, MUTTMENU * m, int num) { - mutt_FormatString (s, slen, NONULL (AliasFmt), alias_format_str, + mutt_FormatString (s, slen, NONULL (AliasFmt), (format_t *) alias_format_str, (unsigned long) ((ALIAS **) m->data)[num], M_FORMAT_ARROWCURSOR); }