[dovecot-cvs] dovecot/src/lib-index mail-index-sync-update.c, 1.24,
1.25
cras at procontrol.fi
cras at procontrol.fi
Mon Jun 14 08:16:12 EEST 2004
Update of /home/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv22813/lib-index
Modified Files:
mail-index-sync-update.c
Log Message:
bugfixes
Index: mail-index-sync-update.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/mail-index-sync-update.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- mail-index-sync-update.c 14 Jun 2004 04:27:44 -0000 1.24
+++ mail-index-sync-update.c 14 Jun 2004 05:16:10 -0000 1.25
@@ -53,9 +53,9 @@
hdr->first_deleted_uid_lowwater = rec->uid;
}
-static void mail_index_sync_expunge(struct mail_index_view *view,
- const struct mail_transaction_expunge *e)
+static int sync_expunge(const struct mail_transaction_expunge *e, void *context)
{
+ struct mail_index_view *view = context;
struct mail_index *index = view->index;
struct mail_index_map *map = view->map;
struct mail_index_header *hdr = &map->hdr_copy;
@@ -69,7 +69,7 @@
i_assert(ret == 0);
if (seq1 == 0)
- return;
+ return 1;
for (seq = seq1; seq <= seq2; seq++) {
rec = MAIL_INDEX_MAP_IDX(index, map, seq-1);
@@ -78,9 +78,9 @@
/* @UNSAFE */
count = seq2 - seq1 + 1;
- memcpy(MAIL_INDEX_MAP_IDX(index, map, seq-1),
- MAIL_INDEX_MAP_IDX(index, map, seq2),
- (map->records_count - seq2) * view->index->record_size);
+ memmove(MAIL_INDEX_MAP_IDX(index, map, seq1-1),
+ MAIL_INDEX_MAP_IDX(index, map, seq2),
+ (map->records_count - seq2) * view->index->record_size);
map->records_count -= count;
hdr->messages_count -= count;
@@ -91,13 +91,6 @@
view->index->record_size);
map->records = buffer_get_modifyable_data(map->buffer, NULL);
}
-}
-
-static int sync_expunge(const struct mail_transaction_expunge *e, void *context)
-{
- struct mail_index_view *view = context;
-
- mail_index_sync_expunge(view, e);
return 1;
}
More information about the dovecot-cvs
mailing list