Author: rfm
Date: Tue Jun  7 09:12:25 2016
New Revision: 39842

URL: http://svn.gna.org/viewcvs/gnustep?rev=39842&view=rev
Log:
fixup conversion to 7bit-safe

Modified:
    libs/base/trunk/Source/Additions/GSMime.m

Modified: libs/base/trunk/Source/Additions/GSMime.m
URL: 
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Source/Additions/GSMime.m?rev=39842&r1=39841&r2=39842&view=diff
==============================================================================
--- libs/base/trunk/Source/Additions/GSMime.m   (original)
+++ libs/base/trunk/Source/Additions/GSMime.m   Tue Jun  7 09:12:25 2016
@@ -5734,19 +5734,30 @@
       GSMimeHeader     *h = [self headerNamed: @"content-transfer-encoding"];
       NSString         *v = [h value];
 
-      if ([v isEqual: @"binary"] == YES || [v isEqual: @"8bit"] == YES)
-       {
-          h = [self headerNamed: @"content-type"];
-          v = [h value];
-
-          if ([v hasPrefix: @"text/"])
-            {
-              [h setValue: @"quoted-printable"];
-            }
-          else
-            {
-              [h setValue: @"base64"];
-            }
+      if (nil == h
+       || YES == [v isEqualToString: @"binary"]
+       || YES == [v isEqualToString: @"8bit"])
+       {
+         NSString      *t = [[doc headerNamed @"content-type"] value]
+
+         if (YES == [t hasPrefix: @"text/"])
+           {
+             t = @"quoted-printable";
+           }
+         else
+           {
+             t = @"base64";
+           }
+         if (nil == h)
+           {
+             [doc setHeader: @"Content-Transfer-Encoding"
+                      value: t
+                 parameters: nil];
+           }
+         else
+           {
+             [h setValue: t];
+           }
        }
     }
 }


_______________________________________________
Gnustep-cvs mailing list
Gnustep-cvs@gna.org
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to