[dovecot-cvs] dovecot/src/lib-storage/index index-sync.c,1.38,1.39
cras at dovecot.org
cras at dovecot.org
Thu Sep 2 19:53:08 EEST 2004
Update of /home/cvs/dovecot/src/lib-storage/index
In directory talvi:/tmp/cvs-serv5696/lib-storage/index
Modified Files:
index-sync.c
Log Message:
Recent flags might have been wrong if they weren't set in ascending order.
Index: index-sync.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-sync.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- index-sync.c 12 Jul 2004 11:35:51 -0000 1.38
+++ index-sync.c 2 Sep 2004 16:53:06 -0000 1.39
@@ -18,20 +18,21 @@
void index_mailbox_set_recent(struct index_mailbox *ibox, uint32_t seq)
{
unsigned char *p;
- static char flag;
+ size_t dest_idx;
if (ibox->recent_flags_start_seq == 0) {
ibox->recent_flags =
buffer_create_dynamic(default_pool, 128, (size_t)-1);
ibox->recent_flags_start_seq = seq;
} else if (seq < ibox->recent_flags_start_seq) {
- buffer_copy(ibox->recent_flags,
- ibox->recent_flags_start_seq - seq,
+ dest_idx = ibox->recent_flags_start_seq - seq;
+ buffer_copy(ibox->recent_flags, dest_idx,
ibox->recent_flags, 0, (size_t)-1);
+ memset(buffer_get_modifyable_data(ibox->recent_flags, NULL),
+ 0, dest_idx);
ibox->recent_flags_start_seq = seq;
}
- flag = TRUE;
p = buffer_get_space_unsafe(ibox->recent_flags,
seq - ibox->recent_flags_start_seq, 1);
if (*p == 0) {
More information about the dovecot-cvs
mailing list