projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mhl and mhbuild ignore to long lines
[mmh]
/
uip
/
mhoutsbr.c
diff --git
a/uip/mhoutsbr.c
b/uip/mhoutsbr.c
index
4d04b65
..
2915afe
100644
(file)
--- a/
uip/mhoutsbr.c
+++ b/
uip/mhoutsbr.c
@@
-9,9
+9,7
@@
#include <h/mh.h>
#include <fcntl.h>
#include <h/mh.h>
#include <fcntl.h>
-#include <h/signals.h>
#include <errno.h>
#include <errno.h>
-#include <signal.h>
#include <h/tws.h>
#include <h/mime.h>
#include <h/mhparse.h>
#include <h/tws.h>
#include <h/mime.h>
#include <h/mhparse.h>
@@
-163,12
+161,15
@@
static void
output_headers(CT ct, FILE *out)
{
HF hp;
output_headers(CT ct, FILE *out)
{
HF hp;
+ charstring_t body = charstring_create(0);
hp = ct->c_first_hf;
while (hp) {
hp = ct->c_first_hf;
while (hp) {
- fprintf(out, "%s:%s", hp->name, hp->value);
+ fold(body, strlen(hp->name), hp->value);
+ fprintf(out, "%s:%s", hp->name, charstring_buffer(body));
hp = hp->next;
}
hp = hp->next;
}
+ charstring_free(body);
}
}
@@
-230,7
+231,7
@@
writeQuoted(CT ct, FILE *out)
n = 0;
}
for (; *cp; cp++) {
n = 0;
}
for (; *cp; cp++) {
- if (n > CPERLIN - 3) {
+ if (n + 1 >= CPERLIN) {
fputs("=\n", out);
n = 0;
}
fputs("=\n", out);
n = 0;
}
@@
-243,8
+244,16
@@
writeQuoted(CT ct, FILE *out)
break;
default:
break;
default:
- if (*cp < '!' || *cp > '~')
+ if (*cp < '!' || *cp > '~') {
goto three_print;
goto three_print;
+ }
+ if (n == 0 && *cp == '.') {
+ /*
+ ** encode dot at start of line,
+ ** because it could be alone ...
+ */
+ goto three_print;
+ }
putc(*cp, out);
n++;
break;
putc(*cp, out);
n++;
break;