dovecot-1.2: virtual: Fix to previous commit.
dovecot at dovecot.org
dovecot at dovecot.org
Tue May 26 08:53:57 EEST 2009
details: http://hg.dovecot.org/dovecot-1.2/rev/abad454e99bb
changeset: 9091:abad454e99bb
user: Timo Sirainen <tss at iki.fi>
date: Tue May 26 01:53:50 2009 -0400
description:
virtual: Fix to previous commit.
diffstat:
1 file changed, 13 insertions(+), 7 deletions(-)
src/plugins/virtual/virtual-sync.c | 20 +++++++++++++-------
diffs (45 lines):
diff -r 7c162aa78714 -r abad454e99bb src/plugins/virtual/virtual-sync.c
--- a/src/plugins/virtual/virtual-sync.c Tue May 26 01:36:51 2009 -0400
+++ b/src/plugins/virtual/virtual-sync.c Tue May 26 01:53:50 2009 -0400
@@ -760,6 +760,7 @@ static void virtual_sync_drop_nonexistin
struct seq_range_iter iter;
unsigned int i, n = 0, count;
uint32_t remove_uid;
+ bool iter_done = FALSE;
seq_range_array_iter_init(&iter, removed_uids);
if (!seq_range_array_iter_nth(&iter, n++, &remove_uid))
@@ -768,21 +769,26 @@ static void virtual_sync_drop_nonexistin
uidmap = array_get_modifiable(&bbox->uids, &count);
(void)bsearch_insert_pos(&remove_uid, uidmap, count, sizeof(*uidmap),
virtual_backend_uidmap_bsearch_cmp, &i);
- if (i == count)
- return;
-
- t_array_init(&drop_uids, array_count(removed_uids));
+
+ t_array_init(&drop_uids, array_count(removed_uids)); iter_done = FALSE;
for (; i < count; ) {
if (uidmap[i].real_uid < remove_uid) {
i++;
continue;
}
- if (uidmap[i].real_uid != remove_uid) {
+ if (uidmap[i].real_uid != remove_uid)
seq_range_array_add(&drop_uids, 0, remove_uid);
+ else
i++;
- }
- if (!seq_range_array_iter_nth(&iter, n++, &remove_uid))
+ if (!seq_range_array_iter_nth(&iter, n++, &remove_uid)) {
+ iter_done = TRUE;
break;
+ }
+ }
+ if (!iter_done) {
+ do {
+ seq_range_array_add(&drop_uids, 0, remove_uid);
+ } while (!seq_range_array_iter_nth(&iter, n++, &remove_uid));
}
seq_range_array_remove_seq_range(removed_uids, &drop_uids);
}
More information about the dovecot-cvs
mailing list