mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-24 20:08:10 +01:00
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.
This commit is contained in:
parent
168211c563
commit
d25dcc589c
2 changed files with 1 additions and 3 deletions
|
@ -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;
|
||||
|
|
|
@ -81,12 +81,10 @@ add_message '[from]="and"' '[subject]="and-and-and"'
|
|||
printf "id:$gen_msg_id\n" > EXPECTED
|
||||
|
||||
test_begin_subtest "quoted xapian keyword search for from:"
|
||||
test_subtest_known_broken
|
||||
notmuch search --output=messages 'from:"and"' > OUTPUT
|
||||
test_expect_equal_file EXPECTED OUTPUT
|
||||
|
||||
test_begin_subtest "quoted xapian keyword search for subject:"
|
||||
test_subtest_known_broken
|
||||
notmuch search --output=messages 'subject:"and-and-and"' > OUTPUT
|
||||
test_expect_equal_file EXPECTED OUTPUT
|
||||
|
||||
|
|
Loading…
Reference in a new issue