]> git.notmuchmail.org Git - notmuch/blobdiff - lib/query.cc
lib: Handle "*" as a query string to match all messages.
[notmuch] / lib / query.cc
index 9266d35f8fc517dbda11d3be9f68a0b47f7105da..10f8dc8a1a7aa0ade1ced3ff129e6cf1143d574f 100644 (file)
@@ -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->