]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
fixes
authorTimo Sirainen <tss@iki.fi>
Mon, 14 Jun 2004 04:54:05 +0000 (07:54 +0300)
committerTimo Sirainen <tss@iki.fi>
Mon, 14 Jun 2004 04:54:05 +0000 (07:54 +0300)
--HG--
branch : HEAD

src/lib-storage/index/mbox/mbox-sync-rewrite.c
src/lib-storage/index/mbox/mbox-sync.c

index 2903489794f670e5f5d87e3ea31b5452f860b6a4..8e936b8f4bdef8e434b61a63d4723eb8e805ce1f 100644 (file)
@@ -394,7 +394,7 @@ int mbox_sync_rewrite(struct mbox_sync_context *sync_ctx, buffer_t *mails_buf,
                                // FIXME: error handling
                                ret = -1;
                        }
-                       mails[1].from_offset -= offset - end_offset;
+                       mails[1].from_offset -= end_offset - start_offset;
                        idx++;
 
                        start_offset += offset - end_offset;
index 91be657d8e62e461ecc7e2b51594b4512d124d5e..cda172fb0b3532dc711c8888dbcde47620729fe3 100644 (file)
@@ -203,14 +203,18 @@ update_from_offsets(struct index_mailbox *ibox,
                    struct mail_index_transaction *t, buffer_t *mails_buf,
                    uint32_t seq1, uint32_t seq2)
 {
-       uint32_t extra_idx = ibox->mbox_extra_idx;
        const struct mbox_sync_mail *mails;
+       uint32_t extra_idx = ibox->mbox_extra_idx;
+       uint64_t offset;
 
        mails = buffer_get_modifyable_data(mails_buf, NULL);
 
        for (; seq1 <= seq2; seq1++, mails++) {
-               uint64_t offset = mails->from_offset;
-               mail_index_update_extra_rec(t, seq1, extra_idx, &offset);
+               if (mails->uid != 0) {
+                       offset = mails->from_offset;
+                       mail_index_update_extra_rec(t, seq1, extra_idx,
+                                                   &offset);
+               }
        }
 }