Ticket #3188: 3188.patch

File 3188.patch, 1.1 KB (added by andrew_b, 10 years ago)
  • lib/strutil/strutil.c

    diff --git a/lib/strutil/strutil.c b/lib/strutil/strutil.c
    index e887a3f..90faa37 100644
    a b GIConv str_cnv_to_term; 
    7070GIConv str_cnv_from_term; 
    7171GIConv str_cnv_not_convert = INVALID_CONV; 
    7272 
     73static void 
     74str_iconv_init (GIConv coder) 
     75{ 
     76    gchar *obuf = NULL; 
     77    gsize oleft = 0; 
     78 
     79    /* Some systems (it seems Solaris 11.1) don't allow NULL outbuf */ 
     80    g_iconv (coder, NULL, NULL, &obuf, &oleft); 
     81} 
     82 
    7383/* if enc is same encoding like on terminal */ 
    7484static int 
    7585str_test_not_convert (const char *enc) 
    _str_convert (GIConv coder, const char *string, int size, GString * buffer) 
    129139    } 
    130140 
    131141    left = size; 
    132     g_iconv (coder, NULL, NULL, NULL, NULL); 
     142    str_iconv_init (coder); 
    133143 
    134144    while (left != 0) 
    135145    { 
    str_translate_char (GIConv conv, const char *keys, size_t ch_size, char *output, 
    290300    size_t left; 
    291301    size_t cnv; 
    292302 
    293     g_iconv (conv, NULL, NULL, NULL, NULL); 
     303    str_iconv_init (conv); 
    294304 
    295305    left = (ch_size == (size_t) (-1)) ? strlen (keys) : ch_size; 
    296306