aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2021-06-18 01:38:03 +0200
committerLeah Neukirchen <leah@vuxu.org>2021-06-18 01:42:34 +0200
commit037091635712d242179676325d1f396aaf93c9fc (patch)
tree33ae8a80e1825aa7239a12baf1ea621debd513ce
parent5c7432aa7b887bdf427f7f5043a6ba3ed0aac7ce (diff)
downloadmblaze-037091635712d242179676325d1f396aaf93c9fc.tar.gz
mblaze-037091635712d242179676325d1f396aaf93c9fc.tar.xz
mblaze-037091635712d242179676325d1f396aaf93c9fc.zip
mmime: generate valid empty mime multipart/mixed when no body is given
-rw-r--r--mmime.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mmime.c b/mmime.c
index 793cb31..2f0636a 100644
--- a/mmime.c
+++ b/mmime.c
@@ -428,7 +428,9 @@ gen_build()
while (1) {
ssize_t read = getdelim(&line, &linelen, '\n', stdin);
if (read == -1) {
- if (feof(stdin))
+ if (!intext && !rflag)
+ line = strdup(inheader ? "\n" : "");
+ else if (feof(stdin))
break;
else
exit(1);