]> git.notmuchmail.org Git - notmuch/blobdiff - lib/parse-sexp.cc
lib/parse-sexp: add '*' as syntactic sugar for '(starts-with "")'
[notmuch] / lib / parse-sexp.cc
index 692b3849a3ae2976656962ec504645073c5679ee..ffb00148393659b8a548c7796285a791b89688a4 100644 (file)
@@ -176,6 +176,11 @@ _sexp_to_xapian_query (notmuch_database_t *notmuch, const _sexp_prefix_t *parent
        std::string term = Xapian::Unicode::tolower (sx->val);
        Xapian::Stem stem = *(notmuch->stemmer);
        std::string term_prefix = parent ? _find_prefix (parent->name) : "";
+
+       if (sx->aty == SEXP_BASIC && strcmp (sx->val, "*") == 0) {
+           return _sexp_parse_wildcard (notmuch, parent, "", output);
+       }
+
        if (parent && (parent->flags & SEXP_FLAG_BOOLEAN)) {
            output = Xapian::Query (term_prefix + sx->val);
            return NOTMUCH_STATUS_SUCCESS;