commit 4f3757b1560b29d590c9b359b250b32ac8cf1bdf
parent fd58a3320d9f5f3e9175153bc77389a9acbd176b
Author: Christoph Lohmann <20h@r-36.net>
Date:   Tue, 11 Mar 2014 00:21:03 +0100
Fix a bug with the new raw output.
Diffstat:
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/part.c b/part.c
@@ -29,8 +29,8 @@ part_printpart(char *id, mime_t *mime)
 	char *filename;
 
 	filename = mime_mkfilename(id, mime);
-	printf("--MIME-Part %s [%s] %s (%d Bytes)\n", mime->partid, mime->ct,
-			filename, mime->bodylen);
+	printf("%s %s %d Bytes %s\n", mime->partid, mime->ct,
+			mime->bodylen, filename);
 	free(filename);
 
 	if (mime->parts->len > 0) {
@@ -78,6 +78,7 @@ part_write(char *id, mime_t *mime, llist_t *partl, char *type,
 		clen = 0;
 		lcontent = mime->body;
 		clen = mime->bodylen;
+		content = NULL;
 		if (!raw) {
 			content = mime_decodepartencoding(mime, &clen);
 			if (content != NULL) {
@@ -153,6 +154,7 @@ partmain(int argc, char *argv[])
 		GIVENNAME = 0x08,
 		TOSTDOUT = 0x10,
 		RAW = 0x20,
+		RECURSIVE = 0x40,
 	};
 
 	retc = 1;
@@ -307,7 +309,8 @@ partmain(int argc, char *argv[])
 
 		mime_free(mime);
 	}
-	llist_free(partl);
+	if (partl != NULL)
+		llist_free(partl);
 	llist_efree(msgs);
 
 	return retc;