notmuch search: Fix to actually return something.
authorCarl Worth <cworth@cworth.org>
Fri, 13 Nov 2009 04:09:12 +0000 (20:09 -0800)
committerCarl Worth <cworth@cworth.org>
Fri, 13 Nov 2009 04:09:12 +0000 (20:09 -0800)
This serves me right for committing untested code. The
notmuch_query_search_threads was totally broken, (it didn't properly
treat -1 as being unlimited and instead returned no threads in that
case).

lib/query.cc

index 1777e47dc044daa339c7ec0988e3d0fbef3de5a9..2169709c7ddcb57980691287670e9cb038c7d151 100644 (file)
@@ -200,7 +200,7 @@ notmuch_query_search_threads (notmuch_query_t *query,
     seen = g_hash_table_new_full (g_str_hash, g_str_equal,
                                  free, NULL);
 
-    while (threads_seen < first + max_threads)
+    while (max_threads < 0 || threads_seen < first + max_threads)
     {
        int messages_seen_previously = messages_seen;