X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fregexp-fields.cc;h=5d4cf80aeea6f145630002c45ac31c4bda5f526c;hp=084bc8c019999cefe7b7d0dff01d27463d6cc4a7;hb=e9b870b6923afe767a7c9938be24f5390102031a;hpb=045f0e455ac94e2393d0d729c9bbdf3459a4860f diff --git a/lib/regexp-fields.cc b/lib/regexp-fields.cc index 084bc8c0..5d4cf80a 100644 --- a/lib/regexp-fields.cc +++ b/lib/regexp-fields.cc @@ -35,9 +35,9 @@ compile_regex (regex_t ®exp, const char *str) if (err != 0) { size_t len = regerror (err, ®exp, NULL, 0); char *buffer = new char[len]; - std::string msg; + std::string msg = "Regexp error: "; (void) regerror (err, ®exp, buffer, len); - msg.assign (buffer, len); + msg.append (buffer, len); delete[] buffer; throw Xapian::QueryParserError (msg); @@ -194,7 +194,7 @@ RegexpFieldProcessor::operator() (const std::string & str) * phrase parsing, when possible */ std::string query_str; - if (str.find (' ') != std::string::npos) + if (*str.rbegin () != '*' || str.find (' ') != std::string::npos) query_str = '"' + str + '"'; else query_str = str;