aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/query.cc
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2010-04-09 16:40:31 -0700
committerGravatar Carl Worth <cworth@cworth.org>2010-04-09 17:43:58 -0700
commite100871981daeb3bb9a6c8718c95e6044953b57f (patch)
treefc91a754674610c77a91fb2984bd0c4dd73cfac3 /lib/query.cc
parentb15a03fafc2e313264519f030e45ea203af508e2 (diff)
lib: Handle "*" as a query string to match all messages.
This seems like a generally useful thing to support, (but the previous support through an empty string was not convenient for some users, (such as the command-line client).
Diffstat (limited to 'lib/query.cc')
-rw-r--r--lib/query.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/query.cc b/lib/query.cc
index 9266d35f..10f8dc8a 100644
--- a/lib/query.cc
+++ b/lib/query.cc
@@ -125,7 +125,9 @@ notmuch_query_search_messages (notmuch_query_t *query)
Xapian::QueryParser::FLAG_WILDCARD |
Xapian::QueryParser::FLAG_PURE_NOT);
- if (strcmp (query_string, "") == 0) {
+ if (strcmp (query_string, "") == 0 ||
+ strcmp (query_string, "*") == 0)
+ {
final_query = mail_query;
} else {
string_query = notmuch->query_parser->
@@ -333,7 +335,9 @@ notmuch_query_count_messages (notmuch_query_t *query)
Xapian::QueryParser::FLAG_WILDCARD |
Xapian::QueryParser::FLAG_PURE_NOT);
- if (strcmp (query_string, "") == 0) {
+ if (strcmp (query_string, "") == 0 ||
+ strcmp (query_string, "*") == 0)
+ {
final_query = mail_query;
} else {
string_query = notmuch->query_parser->