summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-07-15 16:51:43 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-07-15 16:51:43 +0200
commit8c7e822d888b48db883ea9a1f6849d27b799a4f0 (patch)
treeef45c777f25489e5bf790666cba4ca4e68cc521d
parent54b93c8f639a151758541e5739ce8cdb84174395 (diff)
downloadmblaze-8c7e822d888b48db883ea9a1f6849d27b799a4f0.tar.gz
mblaze-8c7e822d888b48db883ea9a1f6849d27b799a4f0.tar.xz
mblaze-8c7e822d888b48db883ea9a1f6849d27b799a4f0.zip
hdr: rfc2047 decode headers
-rw-r--r--Makefile2
-rw-r--r--hdr.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 0768d70..cfed8a3 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ all: $(ALL)
 
 scan: blaze822.o scan.o rfc2047.o
 thread: blaze822.o thread.o
-hdr: blaze822.o hdr.o
+hdr: blaze822.o hdr.o rfc2047.o
 show: blaze822.o show.o
 list: list.o
 next: next.o
diff --git a/hdr.c b/hdr.c
index bc59f75..6dd96ca 100644
--- a/hdr.c
+++ b/hdr.c
@@ -54,8 +54,12 @@ headerall(char *file)
 		return;
 
 	char *h = 0;
-	while ((h = blaze822_next_header(msg, h)))
-		printhdr(h);
+	while ((h = blaze822_next_header(msg, h))) {
+		char d[4096];
+		blaze822_decode_rfc2047(d, h, sizeof d, "UTF-8");
+
+		printhdr(d);
+	}
 }
 
 int