X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=lib%2Fdatabase.cc;h=dcfad8cf2c67306ea9d956d0af9309db06e78187;hb=81bd41c7cb59a8d70932e6bdbee6e1e2cde5477f;hp=b3ffd04dad56ae484544d55cb2e8208961f6004d;hpb=110694b00b79793b3c09a0349c0ff7608df551d6;p=notmuch diff --git a/lib/database.cc b/lib/database.cc index b3ffd04d..dcfad8cf 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -1372,6 +1372,7 @@ notmuch_database_upgrade (notmuch_database_t *notmuch, enum _notmuch_features target_features, new_features; notmuch_status_t status; notmuch_private_status_t private_status; + notmuch_query_t *query = NULL; unsigned int count = 0, total = 0; status = _notmuch_database_ensure_writable (notmuch); @@ -1408,7 +1409,7 @@ notmuch_database_upgrade (notmuch_database_t *notmuch, if (new_features & (NOTMUCH_FEATURE_FILE_TERMS | NOTMUCH_FEATURE_BOOL_FOLDER | NOTMUCH_FEATURE_LAST_MOD)) { - notmuch_query_t *query = notmuch_query_create (notmuch, ""); + query = notmuch_query_create (notmuch, ""); total += notmuch_query_count_messages (query); notmuch_query_destroy (query); } @@ -1436,11 +1437,12 @@ notmuch_database_upgrade (notmuch_database_t *notmuch, if (new_features & (NOTMUCH_FEATURE_FILE_TERMS | NOTMUCH_FEATURE_BOOL_FOLDER | NOTMUCH_FEATURE_LAST_MOD)) { - notmuch_query_t *query = notmuch_query_create (notmuch, ""); notmuch_messages_t *messages; notmuch_message_t *message; char *filename; + query = notmuch_query_create (notmuch, ""); + /* XXX: this should use the _st version, but needs an error path */ for (messages = notmuch_query_search_messages (query); @@ -2653,7 +2655,7 @@ notmuch_database_get_all_tags (notmuch_database_t *db) } const char * -notmuch_database_status_string (notmuch_database_t *notmuch) +notmuch_database_status_string (const notmuch_database_t *notmuch) { return notmuch->status_string; }