Commit Diff


commit - e62289e77996c3cbbb03bffea57790bf55b63adc
commit + a97be00d79c310bff9cd8ac4e749bc5da3441930
blob - a8c14d44402dad9e8fffccfc6d017e4339f42623
blob + f1f9fe48240cb6fdb0269f94d6f97223aa7d9af4
--- textplain.c
+++ textplain.c
@@ -61,8 +61,6 @@ textplain_initparser(struct parser *p)
 	p->name = "text/plain";
 	p->parse = &textplain_parse;
 	p->free = &textplain_free;
-
-	emit_line(p, LINE_PRE_START, NULL, 0);
 }
 
 static int
@@ -107,11 +105,7 @@ textplain_parse(struct parser *p, const char *buf, siz
 static int
 textplain_free(struct parser *p)
 {
-	/* flush the buffer */
-	if (p->len != 0) {
-		if (!emit_line(p, LINE_PRE_CONTENT, p->buf, p->len))
-			return 0;
-	}
-
-	return emit_line(p, LINE_PRE_END, NULL, 0);
+	if (p->len != 0)
+		return emit_line(p, LINE_PRE_CONTENT, p->buf, p->len);
+	return 1;
 }