summaryrefslogtreecommitdiff
path: root/mutt-nntp/crypt-gpgme.patch
blob: 7ed9348b23ceb436cc2333ea922fdf1513aafc09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# HG changeset patch
# User Roman Kagan <rkagan@mail.ru>
# Date 1290506473 -10800
# Node ID 938f0706311a6ab599d29d35447f0c70972fe7cf
# Parent  01731fb1884ea0e1eaf9008ea9c70804b66f2363
crypt-gpgme: actually init gpgme

Recent versions of gpgme (at least the one packaged with Fedora 14,
gpgme-1.2.0), requires proper initialization of the library before use.

The initialization is done via gpgme_check_version(), and gpgme_set_locale() is
recommended right afterwards, too (see gpgme manual for details).

Otherwise gpgme_init() fails with "Not operational" error, which makes mutt
immediately quit.

diff --git a/crypt-gpgme.c b/crypt-gpgme.c
--- a/crypt-gpgme.c
+++ b/crypt-gpgme.c
@@ -4191,6 +4191,12 @@
       if (mutt_any_key_to_continue (NULL) == -1)
 	mutt_exit(1);
     }
+
+  gpgme_check_version (NULL);
+  gpgme_set_locale (NULL, LC_CTYPE, setlocale (LC_CTYPE, NULL));
+#ifdef LC_MESSAGES
+  gpgme_set_locale (NULL, LC_MESSAGES, setlocale (LC_MESSAGES, NULL));
+#endif
 }
 
 void pgp_gpgme_init (void)