]> git.notmuchmail.org Git - notmuch/blobdiff - lib/regexp-fields.cc
lib: use phrase search for anything not ending in '*'
[notmuch] / lib / regexp-fields.cc
index f50da9a3c99baa9841ddb6e1912cff3bc190dbdb..5d4cf80aeea6f145630002c45ac31c4bda5f526c 100644 (file)
@@ -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;