about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-04-15 11:47:25 -0400
committerJune McEnroe <june@causal.agency>2020-04-15 18:56:59 -0400
commitcc6d52f27d6ff5f7d0c9505154eb1a908e859c41 (patch)
tree6e0b3e54a7a78c9e65f49a66b18588c66b040d93
parentVerify that bodyParts is parallel to structure (diff)
downloadbubger-cc6d52f27d6ff5f7d0c9505154eb1a908e859c41.tar.gz
bubger-cc6d52f27d6ff5f7d0c9505154eb1a908e859c41.zip
Tweak fetchParts naming
-rw-r--r--export.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/export.c b/export.c
index 3786220..fe166f8 100644
--- a/export.c
+++ b/export.c
@@ -111,25 +111,25 @@ static void exportAtom(
 	if (error) err(EX_IOERR, "%s", path);
 }
 
-static void exportFetchParts(
-	FILE *imap, struct List *parts, const struct BodyPart *structure
+static void fetchParts(
+	FILE *imap, struct List *section, const struct BodyPart *structure
 ) {
 	if (structure->multipart) {
 		for (size_t i = 0; i < structure->parts.len; ++i) {
 			struct Data part = { .type = Number, .number = 1 + i };
-			listPush(parts, part);
-			exportFetchParts(imap, parts, &structure->parts.ptr[i]);
-			parts->len--;
+			listPush(section, part);
+			fetchParts(imap, section, &structure->parts.ptr[i]);
+			section->len--;
 		}
 	} else if (
 		structure->message.structure &&
 		structure->message.structure->multipart
 	) {
-		exportFetchParts(imap, parts, structure->message.structure);
+		fetchParts(imap, section, structure->message.structure);
 	} else {
 		fprintf(imap, " BODY[");
-		for (size_t i = 0; i < parts->len; ++i) {
-			fprintf(imap, "%s%" PRIu32, (i ? "." : ""), parts->ptr[i].number);
+		for (size_t i = 0; i < section->len; ++i) {
+			fprintf(imap, "%s%" PRIu32, (i ? "." : ""), section->ptr[i].number);
 		}
 		if (structure->message.structure) {
 			fprintf(imap, ".TEXT");
@@ -240,9 +240,9 @@ bool exportData(FILE *imap, enum Atom tag, struct List items) {
 			imap, "%s UID FETCH %" PRIu32 " (UID ENVELOPE BODYSTRUCTURE",
 			Atoms[tag], uid
 		);
-		struct List parts = {0};
-		exportFetchParts(imap, &parts, &structure);
-		listFree(parts);
+		struct List section = {0};
+		fetchParts(imap, &section, &structure);
+		listFree(section);
 		fprintf(imap, ")\r\n");
 	}