server: update query processing

fix quoting issues with mu4e
This commit is contained in:
djcb 2017-10-27 18:43:33 +03:00
parent 6ce7c89488
commit 509500a9d2
4 changed files with 7 additions and 3 deletions

View File

@ -93,7 +93,9 @@ struct MuProc: public Mux::ProcIface {
if (!name || !pfx)
return;
fields.push_back ({{name}, {pfx}, id});
fields.push_back ({{name}, {pfx},
mu_msg_field_xapian_index(id),
id});
}
std::vector<FieldInfo>

View File

@ -557,6 +557,7 @@ read_val (const char *str, const char **endval, GError **err)
}
} else if (*cur == '"') {
quoted = !quoted;
g_string_append_c (gstr, *cur);
continue;
} else if (isblank(*cur) && !quoted)
break;

View File

@ -175,7 +175,8 @@ test_mu_store_store_msg_remove_and_count (void)
g_assert_cmpuint (0,==,mu_store_count (store, NULL));
g_assert_cmpuint (FALSE,==,mu_store_contains_message
(store,
MU_TESTMAILDIR "/cur/1283599333.1840_11.cthulhu!2,", NULL));
MU_TESTMAILDIR "/cur/1283599333.1840_11.cthulhu!2,",
NULL));
g_free (tmpdir);
mu_store_unref (store);
}

View File

@ -113,7 +113,7 @@ test_parse_arglist (void)
GHashTable *hash;
GError *err;
args = "cmd:find query:\"maildir:\\\"/sent items\\\"\" maxnum:500";
args = "cmd:find query:maildir:\"/sent items\" maxnum:500";
err = NULL;
hash = mu_str_parse_arglist (args, &err);