]> Pileus Git - ~andy/fetchmail/commitdiff
Reduce complexity for parsing UIDL response to linear.
authorMatthias Andree <matthias.andree@gmx.de>
Sat, 24 Apr 2010 02:06:25 +0000 (04:06 +0200)
committerMatthias Andree <matthias.andree@gmx.de>
Tue, 14 Dec 2010 16:53:02 +0000 (17:53 +0100)
pop3.c

diff --git a/pop3.c b/pop3.c
index 3e62d86484e3b15b95ae1f8bdb51872397027c7a..04ea97bff11d375f0eb2c4e8a3e4bd8565afd28a 100644 (file)
--- a/pop3.c
+++ b/pop3.c
@@ -1054,6 +1054,7 @@ static int pop3_getrange(int sock,
            {
                /* UIDL worked - parse reply */
                unsigned long unum;
+               struct idlist *newl = NULL;
 
                *newp = 0;
                while (gen_recv(sock, buf, sizeof(buf)) == PS_SUCCESS)
@@ -1063,9 +1064,9 @@ static int pop3_getrange(int sock,
 
                    if (parseuid(buf, &unum, id, sizeof(id)) == PS_SUCCESS)
                    {
-                       struct idlist   *old, *newl;
+                       struct idlist   *old;
 
-                       newl = save_str(&ctl->newsaved, id, UID_UNSEEN);
+                       newl = save_str(newl ? &newl : &ctl->newsaved, id, UID_UNSEEN);
                        newl->val.status.num = unum;
 
                        if ((old = str_in_list(&ctl->oldsaved, id, FALSE)))