From df41a1bb1b7e0a519dfc5ee8c05778cc45aebf94 Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Tue, 13 Feb 2001 12:08:22 +0000 Subject: [PATCH] Match all fields when searching on the query menu. --- query.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/query.c b/query.c index 7a3cdbd6..0da7a04a 100644 --- 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 -- 2.40.0