copyright statements
[apps/madmutt.git] / alias.c
diff --git a/alias.c b/alias.c
index dc5084b..e03536b 100644 (file)
--- a/alias.c
+++ b/alias.c
@@ -1,3 +1,21 @@
+/*
+ *  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., 51 Franklin Street, Fifth Floor, Boston,
+ *  MA 02110-1301, USA.
+ *
+ *  Copyright © 2006 Pierre Habouzit
+ */
 /*
  * Copyright notice from original mutt:
  * Copyright (C) 1996-2002 Michael R. Elkins <me@mutt.org>
@@ -55,6 +73,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 +388,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