Fix uidl-file parsing when not in new format
authorColin Leroy <colin@colino.net>
Mon, 26 Jul 2004 20:25:04 +0000 (20:25 +0000)
committerColin Leroy <colin@colino.net>
Mon, 26 Jul 2004 20:25:04 +0000 (20:25 +0000)
ChangeLog.claws
PATCHSETS
configure.ac
src/pop.c

index 00f350c..178288c 100644 (file)
@@ -1,3 +1,9 @@
+2004-07-26 [colin]     0.9.12cvs35
+
+       * src/pop.c
+               Fix uidl-file parsing when not in new
+               format
+
 2004-07-19 [colin]     0.9.12cvs34
 
        * src/compose.c
index 5ec01a7..daf2f39 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
@@ -21,3 +21,4 @@
 ( cvs diff -u -r 1.64 -r 1.65 src/pop.c; ) > 0.9.12cvs32.patchset
 ( cvs diff -u -r 1.106 -r 1.107 src/folder.h; cvs diff -u -r 1.244 -r 1.245 src/folderview.c; cvs diff -u -r 1.440 -r 1.441 src/summaryview.c; ) > 0.9.12cvs33.patchset
 ( cvs diff -u -r 1.430 -r 1.431 src/compose.c; ) > 0.9.12cvs34.patchset
+( cvs diff -u -r 1.65 -r 1.66 src/pop.c; ) > 0.9.12cvs35.patchset
index 4558f64..611a588 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=12
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=34
+EXTRA_VERSION=35
 EXTRA_RELEASE=
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
index 89905c4..9297554 100644 (file)
--- a/src/pop.c
+++ b/src/pop.c
@@ -583,13 +583,19 @@ void pop3_get_uidl_table(PrefsAccount *ac_prefs, Pop3Session *session)
                recv_time = RECV_TIME_NONE;
                partial_recv = POP3_TOTALLY_RECEIVED;
                
-               if (sscanf(buf, "%s\t%ld\t%s", uidl, &recv_time, &tmp) < 2) {
-                       if (sscanf(buf, "%s", uidl) != 1)
-                               continue;
-                       else {
-                               recv_time = now;
+               if (sscanf(buf, "%s\t%ld\t%s", uidl, &recv_time, &tmp) < 3) {
+                       if (sscanf(buf, "%s\t%ld", uidl, &recv_time) != 2) {
+                               if (sscanf(buf, "%s", uidl) != 1)
+                                       continue;
+                               else {
+                                       recv_time = now;
+                                       strcpy(tmp, "0");
+                               }
+                       } else {
+                               strcpy(tmp, "0");
                        }
                }
+
                if (recv_time == RECV_TIME_NONE)
                        recv_time = RECV_TIME_RECEIVED;
                g_hash_table_insert(table, g_strdup(uidl),