projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rework includes a bit
[apps/madmutt.git]
/
alias.c
diff --git
a/alias.c
b/alias.c
index
e03536b
..
1500dbc
100644
(file)
--- a/
alias.c
+++ b/
alias.c
@@
-47,10
+47,15
@@
#include <lib-ui/enter.h>
#include <lib-ui/menu.h>
#include <lib-ui/enter.h>
#include <lib-ui/menu.h>
-#include "
mutt
.h"
+#include "
alias
.h"
#include "mutt_idna.h"
#include "sort.h"
#include "mutt_idna.h"
#include "sort.h"
+char *AliasFmt;
+char *AliasFile;
+alias_t *Aliases;
+rx_t GecosMask;
+
#define RSORT(x) (SortAlias & SORT_REVERSE) ? -x : x
static struct mapping_t AliasHelp[] = {
#define RSORT(x) (SortAlias & SORT_REVERSE) ? -x : x
static struct mapping_t AliasHelp[] = {
@@
-62,12
+67,13
@@
static struct mapping_t AliasHelp[] = {
{NULL, OP_NULL}
};
{NULL, OP_NULL}
};
-const address_t *alias_lookup(const
alias_t *list, const
char *s)
+const address_t *alias_lookup(const char *s)
{
{
- while (list) {
+ alias_t *list;
+
+ for (list = Aliases; list; list = list->next) {
if (!m_strcasecmp(s, list->name))
return list->addr;
if (!m_strcasecmp(s, list->name))
return list->addr;
- list = list->next;
}
return NULL;
}
return NULL;
@@
-75,12
+81,14
@@
const address_t *alias_lookup(const alias_t *list, const char *s)
/* This routine looks to see if the user has an alias defined for the given
address. */
/* This routine looks to see if the user has an alias defined for the given
address. */
-const address_t *alias_reverse_lookup(const a
lias_t *list, const a
ddress_t *a)
+const address_t *alias_reverse_lookup(const address_t *a)
{
{
+ alias_t *list;
+
if (!a || !a->mailbox)
return NULL;
if (!a || !a->mailbox)
return NULL;
- for (; list; list = list->next) {
+ for (
list = Aliases
; list; list = list->next) {
address_t *ap;
/* cycle through all addresses if this is a group alias */
address_t *ap;
/* cycle through all addresses if this is a group alias */
@@
-225,7
+233,7
@@
void mutt_create_alias(ENVELOPE *cur, address_t *iadr)
return;
/* check to see if the user already has an alias defined */
return;
/* check to see if the user already has an alias defined */
- if (alias_lookup(
Aliases,
buf)) {
+ if (alias_lookup(buf)) {
mutt_error _("You already have an alias defined with that name!");
return;
}
mutt_error _("You already have an alias defined with that name!");
return;
}
@@
-319,7
+327,7
@@
static address_t *mutt_expand_aliases_r(address_t *a, string_list_t **expn)
if (!pop->group && !pop->personal
&& pop->mailbox && !strchr(pop->mailbox, '@'))
{
if (!pop->group && !pop->personal
&& pop->mailbox && !strchr(pop->mailbox, '@'))
{
- const address_t *t = alias_lookup(
Aliases,
pop->mailbox);
+ const address_t *t = alias_lookup(pop->mailbox);
if (t) {
string_list_t *u;
if (t) {
string_list_t *u;
@@
-673,5
+681,4
@@
new_aliases:
mutt_menuDestroy (&menu);
p_delete(&AliasTable);
mutt_menuDestroy (&menu);
p_delete(&AliasTable);
-
}
}