blaze822: compression fixes

This commit is contained in:
Christian Neukirchen 2016-07-13 20:32:44 +02:00
parent d687378b62
commit d0d371114c

View File

@ -260,12 +260,13 @@ unfold_hdr(char *buf, char *end)
} }
} }
// compress fields by removing fws
for (s = buf; s < end; ) { for (s = buf; s < end; ) {
char *t, *h; char *t, *h;
size_t l = strlen(s) + 1; size_t l = strlen(s) + 1;
if ((t = h = strchr(s, '\n'))) { if ((t = h = strchr(s, '\n'))) {
while (*h) { while (h < end && *h) {
if (*h == '\n') { if (*h == '\n') {
*t++ = ' '; *t++ = ' ';
while (*h && isfws(*h)) while (*h && isfws(*h))
@ -273,7 +274,8 @@ unfold_hdr(char *buf, char *end)
} }
*t++ = *h++; *t++ = *h++;
} }
*t = 0; while (t < h)
*t++ = 0;
} }
s += l; s += l;
} }