David Bremner <[email protected]> writes:

>
> Thanks for the report. I don't yet understand where the bug is, but I
> think it's safe to say it's not in your code. I made a somewhat simpler
> test case that displays the same problem (at the end).
>

Oops, I cleverly wiped out my modified test case test-unpacking the
attachment. Luckily I still had it in a buffer. Here it is

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <notmuch.h>

const char *query = "tag:unread to:[email protected] -(tag:unread (shutemov or tag:followed))";
//const char *query = "tag:unread to:[email protected] -(shutemov or tag:followed)";

static void
doit(unsigned int *out) {
  notmuch_database_t *db;
  notmuch_query_t *q;

  assert (NOTMUCH_STATUS_SUCCESS == notmuch_database_open(DB_PATH, 0, &db));
  assert (q = notmuch_query_create(db, query));
  assert (NOTMUCH_STATUS_SUCCESS == notmuch_query_count_messages_st (q, out));
  notmuch_query_destroy(q);
  notmuch_database_close(db);
  notmuch_database_destroy(db);
}

 
int main(int argc, char **argv)
{
  unsigned int count1 = 0, count2 = 0;

    doit(&count1);
    doit(&count2);
    printf("count1: %d, count2: %d\n", count1, count2); 

    return (count1 != count2);
}
_______________________________________________
notmuch mailing list
[email protected]
https://notmuchmail.org/mailman/listinfo/notmuch

Reply via email to