From: Thomas Roessler Date: Tue, 13 Feb 2001 12:08:22 +0000 (+0000) Subject: Match all fields when searching on the query menu. X-Git-Tag: mutt-1-3-16-rel~32 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=df41a1bb1b7e0a519dfc5ee8c05778cc45aebf94;p=mutt Match all fields when searching on the query menu. --- 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