# HG changeset patch # User ali # Date 1378539493 -3600 # Node ID c42c068d29966fec5a441d45bace2f4e559ebf68 # Parent a76161b5bdc6620c2e790b295083d11358b5f3c5 Fix bug with opening and closing iconv instances diff -r a76161b5bdc6 -r c42c068d2996 bookloupe/bookloupe.c --- a/bookloupe/bookloupe.c Fri Sep 06 22:56:56 2013 +0100 +++ b/bookloupe/bookloupe.c Sat Sep 07 08:38:13 2013 +0100 @@ -2659,7 +2659,7 @@ { gsize inbytes,outbytes; gchar *buf,*bp; - GIConv converter=(GIConv)-1; + static GIConv converter=(GIConv)-1; if (!string) { if (converter!=(GIConv)-1) @@ -2667,7 +2667,7 @@ converter=(GIConv)-1; return; } - if (converter=(GIConv)-1) + if (converter==(GIConv)-1) converter=g_iconv_open("WINDOWS-1252","UTF-8"); if (converter!=(GIConv)-1) { @@ -3187,16 +3187,16 @@ gchar *s,*t; gunichar c; GTree *entities=NULL; - GIConv translit=(GIConv)-1,to_utf8=(GIConv)-1; + static GIConv translit=(GIConv)-1,to_utf8=(GIConv)-1; if (!theline) { if (entities) g_tree_destroy(entities); entities=NULL; - if (translit==(GIConv)-1) + if (translit!=(GIConv)-1) g_iconv_close(translit); translit=(GIConv)-1; - if (to_utf8==(GIConv)-1) + if (to_utf8!=(GIConv)-1) g_iconv_close(to_utf8); to_utf8=(GIConv)-1; return;