From: Brendan Cully Date: Tue, 13 Apr 2004 15:10:38 +0000 (+0000) Subject: Fix #1795 X-Git-Tag: mutt-1-5-15-rel~178 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d33dccc629ed84055bfa282ba48bad9f87e83ebf;p=mutt Fix #1795 --- diff --git a/imap/message.c b/imap/message.c index bcc4b3e3..15d0fa55 100644 --- a/imap/message.c +++ b/imap/message.c @@ -760,19 +760,20 @@ static int msg_fetch_header (CONTEXT* ctx, IMAP_HEADER* h, char* buf, FILE* fp) if (msg_parse_fetch (h, buf) != -2) return rc; - if (imap_get_literal_count (buf, &bytes) < 0) - return rc; - imap_read_literal (fp, idata, bytes); - - /* we may have other fields of the FETCH _after_ the literal - * (eg Domino puts FLAGS here). Nothing wrong with that, either. - * This all has to go - we should accept literals and nonliterals - * interchangeably at any time. */ - if (imap_cmd_step (idata) != IMAP_CMD_CONTINUE) - return -2; + if (imap_get_literal_count (buf, &bytes) == 0) + { + imap_read_literal (fp, idata, bytes); + + /* we may have other fields of the FETCH _after_ the literal + * (eg Domino puts FLAGS here). Nothing wrong with that, either. + * This all has to go - we should accept literals and nonliterals + * interchangeably at any time. */ + if (imap_cmd_step (idata) != IMAP_CMD_CONTINUE) + return rc; - if (msg_parse_fetch (h, idata->cmd.buf) == -1) - return rc; + if (msg_parse_fetch (h, idata->cmd.buf) == -1) + return rc; + } rc = 0; /* success */