blaze822: compression fixes

pull/1/merge
Christian Neukirchen 8 years ago
parent d687378b62
commit d0d371114c

@ -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;
} }

Loading…
Cancel
Save