From 795e9c07730855a920c797d1388c928c269a8f88 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 21 Jul 2000 19:30:20 +0000 Subject: [PATCH] Rewrote the code to check for "* %d RECENT". Still needs to be modified, 2000-07-21 Jeffrey Stedfast * providers/imap/camel-imap-store.c (camel_imap_command_extended): Rewrote the code to check for "* %d RECENT". Still needs to be modified, but should no longer cause an infinite loop by detecting mis-detecting RECENT messages. --- camel/ChangeLog | 6 ++++++ camel/providers/imap/camel-imap-store.c | 18 +++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index ea8faf7..74b3ce3 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,9 @@ +2000-07-21 Jeffrey Stedfast + + * providers/imap/camel-imap-store.c (camel_imap_command_extended): Rewrote + the code to check for "* %d RECENT". Still needs to be modified, but should + no longer cause an infinite loop by detecting mis-detecting RECENT messages. + 2000-07-20 Jeffrey Stedfast * providers/imap/camel-imap-folder.c (imap_get_summary): diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c index f20cbfc..0844900 100644 --- a/camel/providers/imap/camel-imap-store.c +++ b/camel/providers/imap/camel-imap-store.c @@ -800,13 +800,17 @@ camel_imap_command_extended (CamelImapStore *store, CamelFolder *folder, char ** g_ptr_array_add (data, respbuf); len += strlen (respbuf) + 1; - if (folder && *respbuf == '*' && (ptr = e_strstrcase (respbuf, "RECENT"))) { - char *rcnt; - - for (rcnt = respbuf; rcnt < ptr && (*rcnt < '0' || *rcnt > '9'); rcnt++); - - if (rcnt < ptr) - recent = atoi (rcnt); + if (*respbuf == '*' && (ptr = strstr (respbuf, "RECENT"))) { + char *rcnt, *ercnt; + + d(fprintf (stderr, "*** We found a 'RECENT' flag: %s", respbuf)); + /* Make sure it's in the form: "* %d RECENT" */ + rcnt = respbuf + 2; + if (*rcnt > '0' || *rcnt < '9') { + for (ercnt = rcnt; ercnt < ptr && *ercnt != ' '; ercnt++); + if (ercnt + 1 == ptr) + recent = atoi (rcnt); + } } } -- 2.7.4