Skip to content

Commit

Permalink
mmime: gen_file: remove check for trailing newline for 7bit transfer
Browse files Browse the repository at this point in the history
RFC2046 5.1.1 specifies that parts without trailing newlines are coded
without problems:

> NOTE:  The CRLF preceding the boundary delimiter line is conceptually
> attached to the boundary so that it is possible to have a part that
> does not end with a CRLF (line break).

This if-statement now also codes empty files correctly.
  • Loading branch information
leahneukirchen committed Apr 23, 2019
1 parent 5b0755c commit 5fa9a7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mmime.c
Expand Up @@ -246,7 +246,7 @@ gen_file(char *file, char *ct)
}

if (bitlow == 0 && bithigh == 0 &&
maxlinelen <= 78 && content[size-1] == '\n') {
maxlinelen <= 78) {
if (!ct)
ct = "text/plain";
printf("Content-Type: %s\n", ct);
Expand Down

0 comments on commit 5fa9a7a

Please sign in to comment.