]> Pileus Git - ~andy/fetchmail/commitdiff
Dick van den Burg's patch.
authorEric S. Raymond <esr@thyrsus.com>
Tue, 17 Mar 1998 18:03:58 +0000 (18:03 -0000)
committerEric S. Raymond <esr@thyrsus.com>
Tue, 17 Mar 1998 18:03:58 +0000 (18:03 -0000)
svn path=/trunk/; revision=1705

NEWS
fetchmail.h
pop3.c
uid.c

diff --git a/NEWS b/NEWS
index 8540def725f7e588a0c2e04ef737144e825a7d15..30f3ed8527e6c5530de3ef0b55f3242f5e31e94d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -16,7 +16,7 @@
                                Release Notes:
 
 ------------------------------------------------------------------------------
-fetchmail-4.4.0 (Fri Mar 13 15:48:27 EST 1998):
+fetchmail-4.4.0 (Mon Mar 16 14:57:38 EST 1998):
 * Fix bug that prevented graceful exit from POP3 validation on wrong password.
 * Dominique Unruh's patch that copes gracefully with bodiless messages.
 * Fix timer-leak problem with the SIGALRM fix, pointed out by Dave Bodenstab.
@@ -25,7 +25,7 @@ fetchmail-4.4.0 (Fri Mar 13 15:48:27 EST 1998):
 * Handle empty Return-Path (thank Dmitry Yaitskov <dyaitskov@insystems.com>).
 * Improvements in UID handling; should be a cleaner fix for Dick van den Burg.
 
-There are 270 people on fetchmail-friends and 160 on fetchmail-announce.
+There are 272 people on fetchmail-friends and 160 on fetchmail-announce.
 
 fetchmail-4.3.9 (Fri Mar  6 10:45:32 EST 1998):
 * Relax the LOGIN capability check in IMAP.
index 76b88bff1a6b57e5e7d50893aaee2878cdd966a8..9dda132cc70671ae265f0e233387897b2fae01eb 100644 (file)
@@ -307,6 +307,7 @@ int delete_str(struct idlist **, int);
 int str_in_list(struct idlist **, const char *);
 int str_nr_in_list(struct idlist **, const char *);
 int str_nr_last_in_list(struct idlist **, const char *);
+void str_set_mark( struct idlist **, const char *, const flag);
 int count_list( struct idlist **idl );
 char *str_from_nr_list( struct idlist **idl, int number );
 char *str_find(struct idlist **, int);
diff --git a/pop3.c b/pop3.c
index 1634755b624df7bde8ff94601b1cf7b05ca4f96f..b03efdff2250c7418a9d3854415aca293634dcee 100644 (file)
--- a/pop3.c
+++ b/pop3.c
@@ -433,8 +433,10 @@ static int pop3_getrange(int sock,
                        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;
+                           str_set_mark(&ctl->oldsaved, id, UID_SEEN);
+                       }
                        else
                            (*newp)++;
                    }
diff --git a/uid.c b/uid.c
index ecc6b0b46dcfce1307777ef7aa9e729404172e50..ac49a013b9fa3f2fff86febfec4eebebb50ad706 100644 (file)
--- a/uid.c
+++ b/uid.c
@@ -93,7 +93,7 @@ void initialize_saved_lists(struct query *hostlist, const char *idfile)
                        strcasecmp(host, ctl->server.truename) == 0
                                && strcasecmp(user, ctl->remotename) == 0)
                    {
-                       save_str(&ctl->oldsaved, id, UID_SEEN);
+                       save_str(&ctl->oldsaved, id, UID_UNSEEN);
                        break;
                    }
                }
@@ -207,6 +207,18 @@ int str_nr_last_in_list( struct idlist **idl, const char *str)
     return ret;
 }
 
+void str_set_mark( struct idlist **idl, const char *str, const flag val)
+/* update the mark on an of an id to given value */
+{
+    int nr;
+    struct idlist *walk;
+    if (!str)
+        return;
+    for(walk = *idl, nr = 0; walk; nr ++, walk = walk->next)
+        if (strcasecmp(str, walk->id) == 0)
+           walk->val.status.mark = val;
+}
+
 int count_list( struct idlist **idl)
 /* count the number of elements in the list */
 {