Fix bug encoding long headers without spaces

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39752 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2016-05-13 11:08:46 +00:00
parent 4a6d6225b9
commit bca2d77fe5
2 changed files with 14 additions and 2 deletions

View file

@ -4058,8 +4058,15 @@ appendString(NSMutableData *m, NSUInteger offset, NSUInteger fold,
/* We have more text to output, so fold the line.
*/
[m appendBytes: "\r\n" length: 2];
[m appendBytes: ptr + pos length: 1];
pos++;
if (isspace(ptr[pos]))
{
[m appendBytes: ptr + pos length: 1];
pos++;
}
else
{
[m appendBytes: " " length: 1];
}
offset = 1;
}
}