From 765e628df69ba9615473b60ea26e02353381e9ff Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 18 Dec 1997 01:42:09 +0000 Subject: Fixed -e 0 bug. svn path=/trunk/; revision=1579 --- imap.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'imap.c') diff --git a/imap.c b/imap.c index 0ad0aa2b..ca9970fb 100644 --- a/imap.c +++ b/imap.c @@ -647,7 +647,7 @@ static int imap_getrange(int sock, else *newp = -1; /* should never happen, RECENT is mandatory */ - expunged = deletions = 0; + expunged = 0; return(PS_SUCCESS); } @@ -826,6 +826,8 @@ static int imap_delete(int sock, struct query *ctl, int number) : "STORE %d +FLAGS (\\Deleted)", number))) return(ok); + else + deletions++; /* * We do an expunge after ctl->expunge messages, rather than @@ -833,7 +835,7 @@ static int imap_delete(int sock, struct query *ctl, int number) * won't result in lots of messages being fetched again during * the next session. */ - if (NUM_NONZERO(ctl->expunge) && (++deletions % ctl->expunge) == 0) + if (NUM_NONZERO(ctl->expunge) && (deletions % ctl->expunge) == 0) { if ((ok = gen_transact(sock, "EXPUNGE"))) return(ok); @@ -843,6 +845,7 @@ static int imap_delete(int sock, struct query *ctl, int number) #endif /* IMAP_UID */ expunged = deletions; + deletions = 0; } return(PS_SUCCESS); @@ -859,6 +862,9 @@ static int imap_logout(int sock, struct query *ctl) if ((ok = gen_transact(sock, "EXPUNGE"))) return(ok); + expunged = deletions; + deletions = 0; + #ifdef IMAP_UID /* not used */ expunge_uids(ctl); #endif /* IMAP_UID */ -- cgit v1.2.3