Author: rfm
Date: Thu Feb 18 16:52:00 2016
New Revision: 39395
URL: http://svn.gna.org/viewcvs/gnustep?rev=39395&view=rev
Log:
Aim to improve compatibility with old/buggy parsers.
Modified:
libs/base/trunk/ChangeLog
libs/base/trunk/Source/Additions/GSMime.m
Modified: libs/base/trunk/ChangeLog
URL:
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/ChangeLog?rev=39395&r1=39394&r2=39395&view=diff
==============================================================================
--- libs/base/trunk/ChangeLog (original)
+++ libs/base/trunk/ChangeLog Thu Feb 18 16:52:00 2016
@@ -1,3 +1,10 @@
+2016-02-18 Richard Frith-Macdonald <[email protected]>
+
+ * Source/Additions/GSMime.m:
+ Fold using tabs between key=value tokens in structured headers
+ in the hope that it will improve compatibility with code which
+ doesn't cope well with a space as the folding character.
+
2016-02-15 Richard Frith-Macdonald <[email protected]>
* Source/NSFileManager.m: Use NSDebugLog for most debug warnings
Modified: libs/base/trunk/Source/Additions/GSMime.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/Additions/GSMime.m?rev=39395&r1=39394&r2=39395&view=diff
==============================================================================
--- libs/base/trunk/Source/Additions/GSMime.m (original)
+++ libs/base/trunk/Source/Additions/GSMime.m Thu Feb 18 16:52:00 2016
@@ -3845,7 +3845,7 @@
uint8_t wsp;
uint8_t buf[3];
- /* Modern folding preserved exact whitespace characters.
+ /* Modern folding preserves exact whitespace characters.
*/
if (size > 0 && isWSP(bytes[0]))
{
@@ -4289,10 +4289,13 @@
/* Crude heuristic ...
* if the length of the key=value will definitely be
* too long to fit on a line, fold right now.
+ * Since we are producing a key=value pair in a structured
+ * field, we use a tab to fold to maximise the chances of a
+ * parser understanding it.
*/
if (fold > 0 && offset + kLength + vLength + 1 >= fold)
{
- [md appendBytes: "\r\n " length: 3];
+ [md appendBytes: "\r\n\t" length: 3];
offset = 1;
}
else
@@ -4310,10 +4313,13 @@
/* Crude heuristic ... if the length of the value will definitely be
* too long to fit on a line, fold right now.
+ * Since we are producing a key=value pair in a structured
+ * field, we use a tab to fold to maximise the chances of a
+ * parser understanding it.
*/
if (fold > 0 && offset + vLength > fold)
{
- [md appendBytes: "\r\n " length: 3];
+ [md appendBytes: "\r\n\t" length: 3];
offset = 1;
}
offset = appendString(md, offset, fold, v, &ok);
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs