about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-11-29 17:44:32 -0500
committerJune McEnroe <june@causal.agency>2020-11-29 17:44:32 -0500
commitaa5164b8fad3137f68a14a11bcc188c76f70e96d (patch)
treedc62a384dfc80b135cd930c59ca9d4ee8d375612
parentUse open_memstream for section specs (diff)
downloadbubger-aa5164b8fad3137f68a14a11bcc188c76f70e96d.tar.gz
bubger-aa5164b8fad3137f68a14a11bcc188c76f70e96d.zip
Fix section spec of multipart/alternative fallback export
They were being exported with paths like
"attachment/messageID//INLINE.HTML".
-rw-r--r--export.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/export.c b/export.c
index 1b6d298..f060c0b 100644
--- a/export.c
+++ b/export.c
@@ -231,11 +231,15 @@ static int exportHTMLBody(
 				&part->parts.ptr[i], dataCheck(body, List).list.ptr[i]
 			);
 		}
-		return exportHTMLBody(
+		struct Data num = { .type = Number, .number = part->parts.len };
+		listPush(section, num);
+		int error = exportHTMLBody(
 			file, envelope, section,
 			&part->parts.ptr[part->parts.len - 1],
 			dataCheck(body, List).list.ptr[part->parts.len - 1]
 		);
+		section->len--;
+		return error;
 
 	} else if (part->multipart) {
 		int error;