X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=notmuch-search.c;h=34e27058658181357e08f7727bc8b3116e8e6f44;hb=53f27aaf73192babf831e907ade71dc16f6880be;hp=fd0b58c5d32fd7b3aed6777eb443a1606758ad5c;hpb=dc2b5a031bb63cd71133237ca5d74ef1223a8925;p=notmuch diff --git a/notmuch-search.c b/notmuch-search.c index fd0b58c5..34e27058 100644 --- a/notmuch-search.c +++ b/notmuch-search.c @@ -90,9 +90,13 @@ get_thread_query (notmuch_thread_t *thread, notmuch_messages_move_to_next (messages)) { notmuch_message_t *message = notmuch_messages_get (messages); const char *mid = notmuch_message_get_message_id (message); + notmuch_bool_t is_set; + char **buf; + + if (notmuch_message_get_flag_st (message, NOTMUCH_MESSAGE_FLAG_MATCH, &is_set)) + return -1; /* Determine which query buffer to extend */ - char **buf = notmuch_message_get_flag ( - message, NOTMUCH_MESSAGE_FLAG_MATCH) ? matched_out : unmatched_out; + buf = is_set ? matched_out : unmatched_out; /* Add this message's id: query. Since "id" is an exclusive * prefix, it is implicitly 'or'd together, so we only need to * join queries with a space. */ @@ -801,7 +805,7 @@ static const notmuch_opt_desc_t common_options[] = { }; int -notmuch_search_command (notmuch_config_t *config, int argc, char *argv[]) +notmuch_search_command (notmuch_config_t *config, unused(notmuch_database_t *notmuch), int argc, char *argv[]) { search_context_t *ctx = &search_context; int opt_index, ret; @@ -867,7 +871,7 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[]) } int -notmuch_address_command (notmuch_config_t *config, int argc, char *argv[]) +notmuch_address_command (notmuch_config_t *config, unused(notmuch_database_t *notmuch), int argc, char *argv[]) { search_context_t *ctx = &search_context; int opt_index, ret;