[PATCH] crypt-gpgme: actually init gpgme
- To: mutt-dev@xxxxxxxx
- Subject: [PATCH] crypt-gpgme: actually init gpgme
- From: Roman Kagan <rkagan@xxxxxxx>
- Date: Tue, 23 Nov 2010 14:41:52 +0300
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:date:from:to:subject :message-id:mail-followup-to:mime-version:content-type :content-disposition:user-agent; bh=Svn6VV6YolKmL7NjldB475vvjhC+b+lQyaJqtICOW0Y=; b=dkPK+vppFI0H6bVmv+YX+6GW7uaAYu0yTTrR/VWsRM21AZEsk1asHnBu2AmcMjfd9/ VKzv+1JlsKf7FB6LoC0Cg/9E8/9chxr2UvEvKfuAoKA5OiD3eqZHUQIF0dADQFyYipMF Vbk1wamPsIV7lYDDebptJEN9JJzF7zNq9r2AQ=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:date:from:to:subject:message-id:mail-followup-to :mime-version:content-type:content-disposition:user-agent; b=p9Y3OIYaUsngJx9x+0Hv0DAEHzmc6rowQcjzq+uqyGu89peVRhJNwDmT91NKBT2FYJ G2i+dnjJs1+myal7anpndYeAHTGHFCDCS4/c11AjzPVuuCftkA8oNfQUx8XBVifWRKb6 I1Gq1MGJqGTd4Y0hRX5Zakt6pRvH/Z2DI/L2g=
- List-post: <mailto:mutt-dev@mutt.org>
- List-unsubscribe: send mail to majordomo@mutt.org, body only "unsubscribe mutt-dev"
- Mail-followup-to: Roman Kagan <rkagan@xxxxxxx>, mutt-dev@xxxxxxxx
- Sender: owner-mutt-dev@xxxxxxxx
- User-agent: Mutt/1.5.21 (2010-09-15)
# HG changeset patch
# User Roman Kagan <rkagan@xxxxxxx>
# 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)