aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2018-09-30 13:27:55 -0300
committerDavid Bremner <david@tethera.net>2019-03-28 14:34:37 -0300
commitd25dcc589ce4c1a87d698c6aef1ce3e38e4a50bb (patch)
treed668d987dad7d41f91b1b1507d80fbaef4b18e50 /lib
parent168211c5632189c53415d25530b759ad3678c92c (diff)
lib: use phrase search for anything not ending in '*'
Anything that does not look like a wildcard should be safe to quote. This should fix the problem searching for xapian keywords.
Diffstat (limited to 'lib')
-rw-r--r--lib/regexp-fields.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/regexp-fields.cc b/lib/regexp-fields.cc
index f50da9a3..5d4cf80a 100644
--- a/lib/regexp-fields.cc
+++ b/lib/regexp-fields.cc
@@ -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;