From eab4a12a632b14436a4c595676a921fdc0d17319 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 14 Apr 2022 14:30:25 +0200 Subject: [PATCH] make sure that entries with deleted placeholders are pruned we need to copy the S_DEL status bits when upgrading sync entries, so that when a placeholder is flagged at the same time for both deletion and upgrade, the entry pruning loop sees that the dummy message got expunged. note that we don't mask any bits, so the post-split entries may end up with S_DEL for a zero UID - which doesn't matter. --- src/sync_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sync_state.c b/src/sync_state.c index 32d1eab..9130b3d 100644 --- a/src/sync_state.c +++ b/src/sync_state.c @@ -615,7 +615,7 @@ upgrade_srec( sync_vars_t *svars, sync_rec_t *srec, int t ) // Mark the original entry for upgrade. srec->status = (srec->status & ~(S_DUMMY(F) | S_DUMMY(N))) | S_PENDING | S_UPGRADE; // Mark the placeholder for nuking. - nsrec->status = S_PURGE; + nsrec->status = S_PURGE | (srec->status & (S_DEL(F) | S_DEL(N))); nsrec->aflags[t] = F_DELETED; return nsrec; }