mirror of https://github.com/djcb/mu.git
* mu-str.c: fix bug in check_for_field
This commit is contained in:
parent
65a2a17209
commit
9133750d24
|
@ -265,8 +265,7 @@ mu_query_new (MuStore *store, GError **err)
|
||||||
try {
|
try {
|
||||||
return new MuQuery (store);
|
return new MuQuery (store);
|
||||||
|
|
||||||
} MU_XAPIAN_CATCH_BLOCK_G_ERROR_RETURN (err,
|
} MU_XAPIAN_CATCH_BLOCK_G_ERROR_RETURN (err, MU_ERROR_XAPIAN, 0);
|
||||||
MU_ERROR_XAPIAN, 0);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -401,7 +401,8 @@ each_check_prefix (MuMsgFieldId mfid, CheckPrefix *cpfx)
|
||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
check_for_field (const char *str, gboolean *is_field, gboolean *is_range_field)
|
check_for_field (const char *str, gboolean *is_field,
|
||||||
|
gboolean *is_range_field)
|
||||||
{
|
{
|
||||||
CheckPrefix pfx;
|
CheckPrefix pfx;
|
||||||
|
|
||||||
|
@ -410,7 +411,7 @@ check_for_field (const char *str, gboolean *is_field, gboolean *is_range_field)
|
||||||
/* skip any non-alphanum starts in cpfx->str; this is to
|
/* skip any non-alphanum starts in cpfx->str; this is to
|
||||||
* handle the case where we have e.g. "(maildir:/abc)"
|
* handle the case where we have e.g. "(maildir:/abc)"
|
||||||
*/
|
*/
|
||||||
while (pfx.str && !isalnum(*pfx.str))
|
while (pfx.str && *pfx.str && !isalnum(*pfx.str))
|
||||||
++pfx.str;
|
++pfx.str;
|
||||||
|
|
||||||
pfx.match = pfx.range_field = FALSE;
|
pfx.match = pfx.range_field = FALSE;
|
||||||
|
|
|
@ -91,12 +91,25 @@ run_and_count_matches (const char *xpath, const char *query)
|
||||||
MuMsgIter *iter;
|
MuMsgIter *iter;
|
||||||
MuStore *store;
|
MuStore *store;
|
||||||
guint count1, count2;
|
guint count1, count2;
|
||||||
|
GError *err;
|
||||||
|
|
||||||
store = mu_store_new_read_only (xpath, NULL);
|
err = NULL;
|
||||||
|
store = mu_store_new_read_only (xpath, &err);
|
||||||
|
if (err) {
|
||||||
|
g_printerr ("error: %s\n", err->message);
|
||||||
|
g_clear_error (&err);
|
||||||
|
err = NULL;
|
||||||
|
}
|
||||||
g_assert (store);
|
g_assert (store);
|
||||||
|
|
||||||
mquery = mu_query_new (store, NULL);
|
mquery = mu_query_new (store, &err);
|
||||||
g_assert (query);
|
if (err) {
|
||||||
|
g_printerr ("error: %s\n", err->message);
|
||||||
|
g_clear_error (&err);
|
||||||
|
err = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_assert (mquery);
|
||||||
|
|
||||||
mu_store_unref (store);
|
mu_store_unref (store);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue