aboutsummaryrefslogtreecommitdiffstats
path: root/imap.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2001-07-31 05:54:41 +0000
committerEric S. Raymond <esr@thyrsus.com>2001-07-31 05:54:41 +0000
commit2dd4055cf26d85600a22205ae6e9ed668d614f26 (patch)
treebe3d15a8fbe7aa76b2310149633b677f08c5b53d /imap.c
parent2cb642fc7d5ad94fe4c48a5d0ec198ab0ac423e9 (diff)
downloadfetchmail-2dd4055cf26d85600a22205ae6e9ed668d614f26.tar.gz
fetchmail-2dd4055cf26d85600a22205ae6e9ed668d614f26.tar.bz2
fetchmail-2dd4055cf26d85600a22205ae6e9ed668d614f26.zip
Must solve that damn linking problem next.
svn path=/trunk/; revision=3426
Diffstat (limited to 'imap.c')
-rw-r--r--imap.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/imap.c b/imap.c
index cfc85fa6..7ea1ef98 100644
--- a/imap.c
+++ b/imap.c
@@ -672,13 +672,19 @@ static int imap_fetch_headers(int sock, struct query *ctl,int number,int *lenp)
gen_send(sock, "FETCH %d RFC822.HEADER", number);
/* looking for FETCH response */
- do {
+ for (;;)
+ {
int ok;
if ((ok = gen_recv(sock, buf, sizeof(buf))))
return(ok);
- } while
- (sscanf(buf+2, "%d FETCH (%*s {%d}", &num, lenp) != 2);
+ if (sscanf(buf+2, "%d FETCH (%*s {%d}", &num, lenp) == 2)
+ break;
+ else if (sscanf(buf+2, "%d NO", &num) == 1)
+ return(PS_ERROR);
+ else if (sscanf(buf+2, "%d BAD", &num) == 1)
+ return(PS_ERROR);
+ }
if (num != number)
return(PS_ERROR);