X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-search.c;h=30722e86f5680abbc5ffa0360c41806eb2499830;hp=44e582cbf416acb42f683609fd9f2491c6dca035;hb=3721bd45d72e50436ee760b03ae533d49bbb8724;hpb=02e394aed216622ac355ff15bae74403abf40417 diff --git a/notmuch-search.c b/notmuch-search.c index 44e582cb..30722e86 100644 --- a/notmuch-search.c +++ b/notmuch-search.c @@ -13,7 +13,7 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program. If not, see http://www.gnu.org/licenses/ . + * along with this program. If not, see https://www.gnu.org/licenses/ . * * Author: Carl Worth */ @@ -121,12 +121,18 @@ do_search_threads (search_context_t *ctx) notmuch_status_t status; if (ctx->offset < 0) { - ctx->offset += notmuch_query_count_threads (ctx->query); + unsigned count; + notmuch_status_t status; + status = notmuch_query_count_threads (ctx->query, &count); + if (print_status_query ("notmuch search", ctx->query, status)) + return 1; + + ctx->offset += count; if (ctx->offset < 0) ctx->offset = 0; } - status = notmuch_query_search_threads_st (ctx->query, &threads); + status = notmuch_query_search_threads (ctx->query, &threads); if (print_status_query("notmuch search", ctx->query, status)) return 1; @@ -521,12 +527,18 @@ do_search_messages (search_context_t *ctx) notmuch_status_t status; if (ctx->offset < 0) { - ctx->offset += notmuch_query_count_messages (ctx->query); + unsigned count; + notmuch_status_t status; + status = notmuch_query_count_messages (ctx->query, &count); + if (print_status_query ("notmuch search", ctx->query, status)) + return 1; + + ctx->offset += count; if (ctx->offset < 0) ctx->offset = 0; } - status = notmuch_query_search_messages_st (ctx->query, &messages); + status = notmuch_query_search_messages (ctx->query, &messages); if (print_status_query ("notmuch search", ctx->query, status)) return 1; @@ -617,7 +629,7 @@ do_search_tags (const search_context_t *ctx) tags = notmuch_database_get_all_tags (notmuch); } else { notmuch_status_t status; - status = notmuch_query_search_messages_st (query, &messages); + status = notmuch_query_search_messages (query, &messages); if (print_status_query ("notmuch search", query, status)) return 1;