2012-11-08 [colin] 3.8.1cvs115
authorColin Leroy <colin@colino.net>
Thu, 8 Nov 2012 09:13:37 +0000 (09:13 +0000)
committerColin Leroy <colin@colino.net>
Thu, 8 Nov 2012 09:13:37 +0000 (09:13 +0000)
* src/plugins/pgpcore/sgpgme.c
Fix Windows runtime crash

ChangeLog
PATCHSETS
configure.ac
src/plugins/pgpcore/sgpgme.c

index a8f0812..1d80d84 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-11-08 [colin]     3.8.1cvs115
+
+       * src/plugins/pgpcore/sgpgme.c
+               Fix Windows runtime crash
+
 2012-11-08 [colin]     3.8.1cvs114
 
        * src/gtk/quicksearch.c
index 8124306..981433a 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.1.2.11 -r 1.1.2.12 doc/man/claws-mail.1;  cvs diff -u -r 1.1.2.117 -r 1.1.2.118 src/gtk/quicksearch.c;  ) > 3.8.1cvs112.patchset
 ( cvs diff -u -r 1.28.2.54 -r 1.28.2.55 src/mbox.c;  ) > 3.8.1cvs113.patchset
 ( cvs diff -u -r 1.1.2.118 -r 1.1.2.119 src/gtk/quicksearch.c;  ) > 3.8.1cvs114.patchset
+( cvs diff -u -r 1.1.2.74 -r 1.1.2.75 src/plugins/pgpcore/sgpgme.c;  ) > 3.8.1cvs115.patchset
index 2a911a4..6278dc8 100644 (file)
@@ -12,7 +12,7 @@ MINOR_VERSION=8
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=114
+EXTRA_VERSION=115
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 7d0fd9f..9749142 100644 (file)
@@ -615,28 +615,44 @@ void sgpgme_init()
        gpgme_engine_info_t engineInfo;
        if (gpgme_check_version("1.0.0")) {
 #ifdef LC_CTYPE
+               debug_print("setting gpgme CTYPE locale\n");
+#ifdef G_OS_WIN32
+               ctype_locale = g_win32_getlocale();
+#else
                ctype_locale = g_strdup(setlocale(LC_CTYPE, NULL));
+#endif
+               debug_print("setting gpgme locale to: %s\n", ctype_locale ? ctype_locale : "NULL");
                if (strchr(ctype_locale, '.'))
                        *(strchr(ctype_locale, '.')) = '\0';
                else if (strchr(ctype_locale, '@'))
                        *(strchr(ctype_locale, '@')) = '\0';
                ctype_utf8_locale = g_strconcat(ctype_locale, ".UTF-8", NULL);
 
+               debug_print("setting gpgme locale to UTF8: %s\n", ctype_utf8_locale ? ctype_utf8_locale : "NULL");
                gpgme_set_locale(NULL, LC_CTYPE, ctype_utf8_locale);
 
+               debug_print("done\n");
                g_free(ctype_utf8_locale);
                g_free(ctype_locale);
 #endif
 #ifdef LC_MESSAGES
+               debug_print("setting gpgme MESSAGES locale\n");
+#ifdef G_OS_WIN32
+               messages_locale = g_win32_getlocale();
+#else
                messages_locale = g_strdup(setlocale(LC_MESSAGES, NULL));
+#endif
+               debug_print("setting gpgme locale to: %s\n", messages_locale ? messages_locale : "NULL");
                if (strchr(messages_locale, '.'))
                        *(strchr(messages_locale, '.')) = '\0';
                else if (strchr(messages_locale, '@'))
                        *(strchr(messages_locale, '@')) = '\0';
                messages_utf8_locale = g_strconcat(messages_locale, ".UTF-8", NULL);
+               debug_print("setting gpgme locale to UTF8: %s\n", messages_utf8_locale ? messages_utf8_locale : "NULL");
 
                gpgme_set_locale(NULL, LC_MESSAGES, messages_utf8_locale);
 
+               debug_print("done\n");
                g_free(messages_utf8_locale);
                g_free(messages_locale);
 #endif