X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;ds=sidebyside;f=lib%2Fregexp-fields.cc;h=539915d892f9529d3d011dfa7611bb37aba718d2;hb=8ed6a172b35708428f84f30af44fa81c12852e43;hp=7e9d959c9b0bc15ffc5b10a9754246750384e668;hpb=c9ed87f39f54b83ecafc719e848909da6074075f;p=notmuch diff --git a/lib/regexp-fields.cc b/lib/regexp-fields.cc index 7e9d959c..539915d8 100644 --- a/lib/regexp-fields.cc +++ b/lib/regexp-fields.cc @@ -227,7 +227,8 @@ RegexpFieldProcessor::operator() (const std::string & str) * phrase parsing, when possible */ std::string query_str; - if (*str.rbegin () != '*' || str.find (' ') != std::string::npos) + if ((str.at (0) != '(' || *str.rbegin () != ')') && + (*str.rbegin () != '*' || str.find (' ') != std::string::npos)) query_str = '"' + str + '"'; else query_str = str;