]> granicus.if.org Git - mutt/commitdiff
Match all fields when searching on the query menu.
authorThomas Roessler <roessler@does-not-exist.org>
Tue, 13 Feb 2001 12:08:22 +0000 (12:08 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Tue, 13 Feb 2001 12:08:22 +0000 (12:08 +0000)
query.c

diff --git a/query.c b/query.c
index 7a3cdbd6af4015fcae9701aaceed304ff52d82eb..0da7a04abf4bc460adf0d34156a44f1325df26e5 100644 (file)
--- a/query.c
+++ b/query.c
@@ -146,7 +146,26 @@ static int query_search (MUTTMENU *m, regex_t *re, int n)
 {
   ENTRY *table = (ENTRY *) m->data;
 
-  return (regexec (re, table[n].data->name, 0, NULL, 0));
+  if (table[n].data->name && !regexec (re, table[n].data->name, 0, NULL, 0))
+    return 0;
+  if (table[n].data->other && !regexec (re, table[n].data->other, 0, NULL, 0))
+    return 0;
+  if (table[n].data->addr)
+  {
+    if (table[n].data->addr->personal && 
+       !regexec (re, table[n].data->addr->personal, 0, NULL, 0))
+      return 0;
+    if (table[n].data->addr->mailbox &&
+       !regexec (re, table[n].data->addr->mailbox, 0, NULL, 0))
+      return 0;
+#ifdef EXACT_ADDRESS
+    if (table[n].data->addr->val &&
+       !regexec (re, table[n].data->addr->val, 0, NULL, 0))
+      return 0;
+#endif
+  }
+  
+  return REG_NOMATCH;
 }
 
 /* This is the callback routine from mutt_menuLoop() which is used to generate