X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fregexp-fields.cc;fp=lib%2Fregexp-fields.cc;h=1651677cd8638b759a9f96838237a98aa2ef5af2;hp=9dcf973263743ea01721bf139569cafa17577943;hb=cb84f8487833c19ce13edb769fa6421547077725;hpb=bc0c051e042650106c5772d1817af1f7db32fb92 diff --git a/lib/regexp-fields.cc b/lib/regexp-fields.cc index 9dcf9732..1651677c 100644 --- a/lib/regexp-fields.cc +++ b/lib/regexp-fields.cc @@ -148,6 +148,11 @@ RegexpFieldProcessor::RegexpFieldProcessor (std::string prefix, Xapian::QueryPar Xapian::Query RegexpFieldProcessor::operator() (const std::string & str) { + if (str.size () == 0) + return Xapian::Query(Xapian::Query::OP_AND_NOT, + Xapian::Query::MatchAll, + Xapian::Query (Xapian::Query::OP_WILDCARD, term_prefix)); + if (str.at (0) == '/') { if (str.at (str.size () - 1) == '/'){ RegexpPostingSource *postings = new RegexpPostingSource (slot, str.substr(1,str.size () - 2));