Author: thebeing
Date: Thu Jan 21 23:20:53 2016
New Revision: 39303

URL: http://svn.gna.org/viewcvs/gnustep?rev=39303&view=rev
Log:
Fix folding of headers containing underscores.

The quotedWord() and quotableLength() functions were
disagreeing about which characters to quote. 


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=39303&r1=39302&r2=39303&view=diff
==============================================================================
--- libs/base/trunk/ChangeLog   (original)
+++ libs/base/trunk/ChangeLog   Thu Jan 21 23:20:53 2016
@@ -1,3 +1,8 @@
+2016-01-21     Niels Grewe <[email protected]>
+
+       * Source/Additions/GSMime.m: Fix folding of headers containing
+       a '_' character.
+
 2016-01-21     Niels Grewe <[email protected]>
 
        * Tests/base/GSMime/general.m: Test case for quoted boundary

Modified: libs/base/trunk/Source/Additions/GSMime.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/Additions/GSMime.m?rev=39303&r1=39302&r2=39303&view=diff
==============================================================================
--- libs/base/trunk/Source/Additions/GSMime.m   (original)
+++ libs/base/trunk/Source/Additions/GSMime.m   Thu Jan 21 23:20:53 2016
@@ -3750,6 +3750,8 @@
   return NSNotFound;
 }
 
+static char* _charsToEncode = "()<>@,;:_\"/[]?.=";
+
 static NSUInteger
 quotableLength(const uint8_t *ptr, NSUInteger size, NSUInteger max,
   NSUInteger *quotedLength)
@@ -3762,7 +3764,7 @@
       uint8_t   c = ptr[index];
       int       add = 1;
 
-      if (c < 32 || c >= 127 || strchr("()<>@,;:\"/[]?.=", c))
+      if (c < 32 || c >= 127 || strchr(_charsToEncode, c))
         {
           add += 2;
         }
@@ -3790,7 +3792,7 @@
         {
           buffer[encoded++] = '_';
         }
-      else if (c < 32 || c >= 127 || strchr("()<>@,;:_\"/[]?.=", c))
+      else if (c < 32 || c >= 127 || strchr(_charsToEncode, c))
         {
           buffer[encoded++] = '=';
           buffer[encoded++] = hex[c>>4];


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to