aboutsummaryrefslogtreecommitdiffstats
path: root/imap.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-12-18 01:42:09 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-12-18 01:42:09 +0000
commit765e628df69ba9615473b60ea26e02353381e9ff (patch)
treefcc37b55fca57cffaa05be6f77682ed830cf095f /imap.c
parent343eba8240decd64ab424eee9d9b1d15b53cce9c (diff)
downloadfetchmail-765e628df69ba9615473b60ea26e02353381e9ff.tar.gz
fetchmail-765e628df69ba9615473b60ea26e02353381e9ff.tar.bz2
fetchmail-765e628df69ba9615473b60ea26e02353381e9ff.zip
Fixed -e 0 bug.
svn path=/trunk/; revision=1579
Diffstat (limited to 'imap.c')
-rw-r--r--imap.c10
1 files changed, 8 insertions, 2 deletions
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 */