diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2001-07-31 05:54:41 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2001-07-31 05:54:41 +0000 |
commit | 2dd4055cf26d85600a22205ae6e9ed668d614f26 (patch) | |
tree | be3d15a8fbe7aa76b2310149633b677f08c5b53d /imap.c | |
parent | 2cb642fc7d5ad94fe4c48a5d0ec198ab0ac423e9 (diff) | |
download | fetchmail-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.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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); |