# HG changeset patch # User Timo Sirainen # Date 1174847236 -10800 # Node ID bea1e1bab54af179f60c0e115e98c650cc3066c2 # Parent 73032525bca0561fdd75977af8add15ec332c36b Fixes diff -r 73032525bca0 -r bea1e1bab54a src/lib-mail/message-parser.c --- a/src/lib-mail/message-parser.c Sun Mar 25 21:26:53 2007 +0300 +++ b/src/lib-mail/message-parser.c Sun Mar 25 21:27:16 2007 +0300 @@ -319,24 +319,30 @@ } for (i = boundary_start = 0; i < block_r->size; i++) { + /* skip to beginning of the next line. the first line was + handled already. */ for (; i < block_r->size; i++) { if (data[i] == '\n') { boundary_start = i; if (i > 0 && data[i-1] == '\r') boundary_start--; + i++; break; } } - if (boundary_start != 0) + if (boundary_start != 0) { + /* we can skip the first lines. input buffer can't be + full anymore. */ full = FALSE; + } - ret = boundary_line_find(ctx, block_r->data + i + 1, - block_r->size - (i + 1), full, + ret = boundary_line_find(ctx, block_r->data + i, + block_r->size - i, full, &boundary); if (ret >= 0) { /* found / need more data */ if (ret == 0 && boundary_start == 0) - ctx->want_count += i + 1; + ctx->want_count += i; break; } }