]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-mail: message-parser - Add boundary_remove_until() helper function
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 23 Apr 2020 11:53:27 +0000 (14:53 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 27 May 2020 05:28:17 +0000 (08:28 +0300)
src/lib-mail/message-parser.c

index f0a0cf41f0267c0514ccf754c268eed57827f6f7..0fb0f9181afc7c85b43684de12ab94d1c0e89197 100644 (file)
@@ -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. */