X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=alias.c;h=e0711c342f750b9295ec6b70197285d74ce4ebfc;hp=dc5084bfe36163b9a1848df9552972acad0a54b5;hb=d4321859bb9ce5b43fbd8303394cf98ae7720a38;hpb=108f3c7ab59844591f7540347914ea57be5245e2 diff --git a/alias.c b/alias.c index dc5084b..e0711c3 100644 --- a/alias.c +++ b/alias.c @@ -55,6 +55,27 @@ const address_t *alias_lookup(const alias_t *list, const char *s) return NULL; } +/* This routine looks to see if the user has an alias defined for the given + address. */ +const address_t *alias_reverse_lookup(const alias_t *list, const address_t *a) +{ + if (!a || !a->mailbox) + return NULL; + + for (; list; list = list->next) { + address_t *ap; + + /* cycle through all addresses if this is a group alias */ + for (ap = list->addr; ap; ap = ap->next) { + if (!ap->group && ap->mailbox + && !ascii_strcasecmp(ap->mailbox, a->mailbox)) + return ap; + } + } + + return NULL; +} + static int string_is_address(const char *str, const char *u, const char *d) { char buf[LONG_STRING]; @@ -349,30 +370,6 @@ void mutt_expand_aliases_env(ENVELOPE *env) /************* READ MARK *********************/ - -/* - * This routine looks to see if the user has an alias defined for the given - * address. - */ -address_t *alias_reverse_lookup (address_t * a) -{ - alias_t *t = Aliases; - address_t *ap; - - if (!a || !a->mailbox) - return NULL; - - for (; t; t = t->next) { - /* cycle through all addresses if this is a group alias */ - for (ap = t->addr; ap; ap = ap->next) { - if (!ap->group && ap->mailbox && - ascii_strcasecmp (ap->mailbox, a->mailbox) == 0) - return ap; - } - } - return 0; -} - /* alias_complete() -- alias completion routine * * given a partial alias, this routine attempts to fill in the alias