aboutsummaryrefslogtreecommitdiffstats
path: root/pop3.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1998-03-13 20:20:19 +0000
committerEric S. Raymond <esr@thyrsus.com>1998-03-13 20:20:19 +0000
commitd3833f31da28808274c6d08804646116be7dabb8 (patch)
tree985ae69fd971dffb43a300f92f3b4867857267ab /pop3.c
parent8517cf573fdb368fa69d776bc113cd95c6646edb (diff)
downloadfetchmail-d3833f31da28808274c6d08804646116be7dabb8.tar.gz
fetchmail-d3833f31da28808274c6d08804646116be7dabb8.tar.bz2
fetchmail-d3833f31da28808274c6d08804646116be7dabb8.zip
Re-engineer the UIDL stuff to avoid having the status flag collide
with message numbers. svn path=/trunk/; revision=1699
Diffstat (limited to 'pop3.c')
-rw-r--r--pop3.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/pop3.c b/pop3.c
index 3004e747..1634755b 100644
--- a/pop3.c
+++ b/pop3.c
@@ -331,11 +331,14 @@ pop3_slowuidl( int sock, struct query *ctl, int *countp, int *newp)
}
}
}
- /* The first try_id messages are known -> copy them to
- the newsaved list */
+ /* the first try_id messages are known -> copy them to the newsaved list */
for( num = first_nr; num < list_len; num++ )
- save_str(&ctl->newsaved, num-first_nr + 1,
- str_from_nr_list( &ctl->oldsaved, num ));
+ {
+ struct idlist *new = save_str(&ctl->newsaved,
+ str_from_nr_list(&ctl->oldsaved, num),
+ UID_UNSEEN);
+ new->val.status.num = num - first_nr + 1;
+ }
if( nolinear ) {
free_str_list(&ctl->oldsaved);
@@ -424,10 +427,15 @@ static int pop3_getrange(int sock,
break;
else if (sscanf(buf, "%d %s", &num, id) == 2)
{
- save_str(&ctl->newsaved, num, id);
+ struct idlist *new;
+
+ new = save_str(&ctl->newsaved, id, UID_UNSEEN);
+ new->val.status.num = num;
/* note: ID comparison is caseblind */
- if (!str_in_list(&ctl->oldsaved, id))
+ if (str_in_list(&ctl->oldsaved, id))
+ new->val.status.mark = UID_SEEN;
+ else
(*newp)++;
}
}