Commit 03ca3895 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

inetcomm: Unfold headers.

parent 31297b6a
...@@ -228,6 +228,31 @@ static header_t *read_prop(MimeBody *body, char **ptr) ...@@ -228,6 +228,31 @@ static header_t *read_prop(MimeBody *body, char **ptr)
return ret; return ret;
} }
static void unfold_header(char *header, int len)
{
char *start = header, *cp = header;
do {
while(*cp == ' ' || *cp == '\t')
{
cp++;
len--;
}
if(cp != start)
memmove(start, cp, len + 1);
cp = strstr(start, "\r\n");
len -= (cp - start);
start = cp;
*start = ' ';
start++;
len--;
cp += 2;
} while(*cp == ' ' || *cp == '\t');
*(start - 1) = '\0';
}
static void read_value(header_t *header, char **cur) static void read_value(header_t *header, char **cur)
{ {
char *end = *cur, *value; char *end = *cur, *value;
...@@ -243,6 +268,9 @@ static void read_value(header_t *header, char **cur) ...@@ -243,6 +268,9 @@ static void read_value(header_t *header, char **cur)
memcpy(value, *cur, len); memcpy(value, *cur, len);
value[len] = '\0'; value[len] = '\0';
unfold_header(value, len);
TRACE("value %s\n", debugstr_a(value));
header->value.vt = VT_LPSTR; header->value.vt = VT_LPSTR;
header->value.pszVal = value; header->value.pszVal = value;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment