[PATCH 2/2] lib: fix an exclude bug

Mark Walters markwalters1009 at gmail.com
Mon Mar 12 04:31:54 PDT 2012


One test using the new exclude code was failing in some
configurations.  This patch makes it work for me. It may be a "fix"
but I do not see why it fixes it.
---
 lib/query.cc |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/query.cc b/lib/query.cc
index ab18fbc..2b73d72 100644
--- a/lib/query.cc
+++ b/lib/query.cc
@@ -213,13 +213,14 @@ notmuch_query_search_messages (notmuch_query_t *query)
 
 	if (query->exclude_terms) {
 	    exclude_query = _notmuch_exclude_tags (query, final_query);
-	    exclude_query = Xapian::Query (Xapian::Query::OP_AND,
-					   exclude_query, final_query);
 
 	    if (query->omit_excluded_messages)
 		final_query = Xapian::Query (Xapian::Query::OP_AND_NOT,
 					     final_query, exclude_query);
 	    else {
+		exclude_query = Xapian::Query (Xapian::Query::OP_AND,
+					   exclude_query, final_query);
+
 		enquire.set_weighting_scheme (Xapian::BoolWeight());
 		enquire.set_query (exclude_query);
 
-- 
1.7.9.1



More information about the notmuch mailing list