]> Pileus Git - ~andy/fetchmail/commitdiff
Fix crash on --flush.
authorRainer Weikusat <rweikusat@mssgmbh.com>
Sat, 8 Jan 2011 11:46:28 +0000 (12:46 +0100)
committerMatthias Andree <matthias.andree@gmx.de>
Sat, 8 Jan 2011 11:48:30 +0000 (12:48 +0100)
pop3.c

diff --git a/pop3.c b/pop3.c
index bec8ab099a20f758cce66d2d0a309f9ea87fd2c6..9c73ae9d25c55b5169244358d332ceb55350b095 100644 (file)
--- a/pop3.c
+++ b/pop3.c
@@ -919,8 +919,11 @@ static int pop3_getrange(int sock,
                            old_rec = uid_db_insert(&ctl->oldsaved, id, UID_UNSEEN);
 
                        }
-                       /* save the number */
-                       if (new_rec->status == UID_UNSEEN || !ctl->keep) {
+                       /*
+                        * save the number if it will be needed later on
+                        * (messsage will either be fetched or deleted)
+                        */
+                       if (new_rec->status == UID_UNSEEN || ctl->flush) {
                            set_uid_db_num(&ctl->oldsaved, old_rec, unum);
                            set_uid_db_num(&ctl->newsaved, new_rec, unum);
                        }