]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mail_index_sync_get_offsets() now returns offset1 right.
authorTimo Sirainen <tss@iki.fi>
Mon, 23 Mar 2009 20:53:30 +0000 (16:53 -0400)
committerTimo Sirainen <tss@iki.fi>
Mon, 23 Mar 2009 20:53:30 +0000 (16:53 -0400)
--HG--
branch : HEAD

src/lib-index/mail-index-sync.c

index 1df834add06694be33cf34dce8aeb3760e93c2fa..d30c46b2cf20a319e4819d29c1945ae1f10ad4ed 100644 (file)
@@ -542,7 +542,9 @@ void mail_index_sync_get_offsets(struct mail_index_sync_ctx *ctx,
                                 uint32_t *seq2_r, uoff_t *offset2_r)
 {
        *seq1_r = ctx->view->map->hdr.log_file_seq;
-       *offset1_r = ctx->view->map->hdr.log_file_tail_offset;
+       *offset1_r = ctx->view->map->hdr.log_file_tail_offset != 0 ?
+               ctx->view->map->hdr.log_file_tail_offset :
+               ctx->view->index->log->head->hdr.hdr_size;
        mail_transaction_log_get_head(ctx->view->index->log, seq2_r, offset2_r);
 }