X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=lib%2Fquery.cc;h=d241dc1dc819a6246e2bfc791330c5448dc9548e;hb=a258cb32b318d831fab5ef64329bd65119b47def;hp=3e20f59c8ce9951a1501ac8b7002e2f0a56df7a1;hpb=4971b85641def6b17072ae1b0de0adf15d197f2c;p=notmuch diff --git a/lib/query.cc b/lib/query.cc index 3e20f59c..d241dc1d 100644 --- a/lib/query.cc +++ b/lib/query.cc @@ -148,6 +148,8 @@ notmuch_query_search_messages (notmuch_query_t *query) case NOTMUCH_SORT_MESSAGE_ID: enquire.set_sort_by_value (NOTMUCH_VALUE_MESSAGE_ID, FALSE); break; + case NOTMUCH_SORT_UNSORTED: + break; } #if DEBUG_QUERY @@ -161,14 +163,16 @@ notmuch_query_search_messages (notmuch_query_t *query) messages->iterator = mset.begin (); messages->iterator_end = mset.end (); + return &messages->base; + } catch (const Xapian::Error &error) { fprintf (stderr, "A Xapian exception occurred performing query: %s\n", error.get_msg().c_str()); fprintf (stderr, "Query string was: %s\n", query->query_string); notmuch->exception_reported = TRUE; + talloc_free (messages); + return NULL; } - - return &messages->base; } notmuch_bool_t