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:
rfm 2016-05-13 11:08:46 +00:00
parent 8842de896f
commit d0e1834a37
2 changed files with 14 additions and 2 deletions

View file

@ -1,3 +1,8 @@
2016-05-13 Richard Frith-Macdonald <rfm@gnu.org>
* Source/Additions/GSMime.m:
Fix bug encoding very long headers with no whitespace to fold on.
2016-05-06 18:03-EDT Gregory John Casamento <greg.casamento@gmail.com>
* Headers/Foundation/NSString.h: Add containsString:

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