diff options
author | Eric S. Raymond <esr@thyrsus.com> | 1997-06-04 17:15:32 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 1997-06-04 17:15:32 +0000 |
commit | 70a06cd47ab03c4fff76ec218f7cc92574600fd6 (patch) | |
tree | 594fa312881a76ac36dfcc26d414c6ec0067ad31 /imap.c | |
parent | e8baecef560203acf8f955e32f9d7fa9767a1624 (diff) | |
download | fetchmail-70a06cd47ab03c4fff76ec218f7cc92574600fd6.tar.gz fetchmail-70a06cd47ab03c4fff76ec218f7cc92574600fd6.tar.bz2 fetchmail-70a06cd47ab03c4fff76ec218f7cc92574600fd6.zip |
Fix Rob Funk's bug.
svn path=/trunk/; revision=1061
Diffstat (limited to 'imap.c')
-rw-r--r-- | imap.c | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -47,7 +47,19 @@ int imap_ok (int sock, char *argbuf) if (strstr(buf, "RECENT")) recent = atoi(buf+2); if (strstr(buf, "UNSEEN")) - unseen = atoi(buf+2); + { + char *cp; + + /* + * Handle both "* 42 UNSEEN" and "* OK [UNSEEN 42] 42". + */ + unseen = 0; + for (cp = buf; *cp && !isdigit(*cp); cp++) + { + unseen = atoi(cp); + break; + } + } if (strstr(buf, "FLAGS")) seen = (strstr(buf, "Seen") != (char *)NULL); } while |