From: Timo Sirainen Date: Thu, 23 Apr 2020 11:53:27 +0000 (+0300) Subject: lib-mail: message-parser - Add boundary_remove_until() helper function X-Git-Tag: 2.3.11.2~49 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bfba2a503a0d4e00a6dc2b24c0ec535f4fc5d845;p=thirdparty%2Fdovecot%2Fcore.git lib-mail: message-parser - Add boundary_remove_until() helper function --- diff --git a/src/lib-mail/message-parser.c b/src/lib-mail/message-parser.c index f0a0cf41f0..0fb0f9181a 100644 --- a/src/lib-mail/message-parser.c +++ b/src/lib-mail/message-parser.c @@ -173,6 +173,13 @@ static void message_part_finish(struct message_parser_ctx *ctx) ctx->part = ctx->part->parent; } +static void +boundary_remove_until(struct message_parser_ctx *ctx, + struct message_boundary *boundary) +{ + ctx->boundaries = boundary; +} + static void parse_next_body_multipart_init(struct message_parser_ctx *ctx) { struct message_boundary *b; @@ -314,10 +321,10 @@ static int parse_part_finish(struct message_parser_ctx *ctx, if (boundary->epilogue_found) { /* this boundary isn't needed anymore */ - ctx->boundaries = boundary->next; + boundary_remove_until(ctx, boundary->next); } else { /* forget about the boundaries we possibly skipped */ - ctx->boundaries = boundary; + boundary_remove_until(ctx, boundary); } /* the boundary itself should already be in buffer. add that. */