]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Make mailbox_header_lookup_ctx's list of headers available.
authorTimo Sirainen <tss@iki.fi>
Sat, 25 Oct 2008 19:50:43 +0000 (22:50 +0300)
committerTimo Sirainen <tss@iki.fi>
Sat, 25 Oct 2008 19:50:43 +0000 (22:50 +0300)
--HG--
branch : HEAD

src/lib-storage/index/index-mail-headers.c
src/lib-storage/mail-storage-private.h

index 23687a47f7546c94f67b722b5f6c64e4dc163c33..5c4aa96c729f2029d2b8fa52a58458995f240d19 100644 (file)
@@ -808,13 +808,14 @@ index_header_lookup_init_real(struct mailbox *box, const char *const headers[])
        ctx->count = count;
 
        ctx->idx = p_new(pool, unsigned int, count);
-       ctx->name = p_new(pool, const char *, count);
+       ctx->name = p_new(pool, const char *, count + 1);
 
        /* @UNSAFE */
        for (i = 0; i < count; i++) {
                ctx->idx[i] = fields[i].idx;
                ctx->name[i] = p_strdup(pool, headers[i]);
        }
+       ctx->ctx.headers = ctx->name;
        return &ctx->ctx;
 }
 
index 3c31831eb659138e5edd1c371d8538ccabd6f28e..e4b9b531bf3a79d7dd864b9454e80f9ed2b12766 100644 (file)
@@ -332,6 +332,7 @@ struct mailbox_sync_context {
 
 struct mailbox_header_lookup_ctx {
        struct mailbox *box;
+       const char *const *headers;
 };
 
 /* Modules should use do "my_id = mail_storage_module_id++" and