[gmime] If GMimeParam:method is DEFAULT, use GMimeFormatOptions:method



commit af680095808d857cfe743b67475192bcaf822dc0
Author: Jeffrey Stedfast <jestedfa microsoft com>
Date:   Fri Mar 17 22:12:16 2017 -0400

    If GMimeParam:method is DEFAULT, use GMimeFormatOptions:method

 gmime/gmime-param.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/gmime/gmime-param.c b/gmime/gmime-param.c
index 57d87c9..62056de 100644
--- a/gmime/gmime-param.c
+++ b/gmime/gmime-param.c
@@ -613,6 +613,7 @@ static char *
 encode_param (GMimeParam *param, GMimeFormatOptions *options, GMimeParamEncodingMethod *method)
 {
        register const unsigned char *inptr = (const unsigned char *) param->value;
+       GMimeParamEncodingMethod requested;
        const unsigned char *start = inptr;
        const char *charset = NULL;
        iconv_t cd = (iconv_t) -1;
@@ -633,7 +634,12 @@ encode_param (GMimeParam *param, GMimeFormatOptions *options, GMimeParamEncoding
                return g_strdup (param->value);
        }
        
-       if (param->method == GMIME_PARAM_ENCODING_METHOD_RFC2047) {
+       if (param->method == GMIME_PARAM_ENCODING_METHOD_DEFAULT)
+               requested = g_mime_format_options_get_param_encoding_method (options);
+       else
+               requested = param->method;
+       
+       if (requested == GMIME_PARAM_ENCODING_METHOD_RFC2047) {
                *method = GMIME_PARAM_ENCODING_METHOD_RFC2047;
                
                return g_mime_utils_header_encode_text (options, param->value, param->charset);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]