From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id A79BE6DE02DA for ; Sun, 24 Jan 2016 07:22:59 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.657 X-Spam-Level: X-Spam-Status: No, score=0.657 tagged_above=-999 required=5 tests=[AWL=0.005, SPF_NEUTRAL=0.652] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2tR2-t40iawa for ; Sun, 24 Jan 2016 07:22:57 -0800 (PST) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id C99F86DE0217 for ; Sun, 24 Jan 2016 07:22:55 -0800 (PST) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id 8291C10005A; Sun, 24 Jan 2016 17:23:02 +0200 (EET) From: Tomi Ollila To: Daniel Kahn Gillmor , Notmuch Mail Subject: Re: [PATCH v2 04/16] Provide _notmuch_crypto_{set,get}_gpg_path In-Reply-To: <1453258369-7366-5-git-send-email-dkg@fifthhorseman.net> References: <1453258369-7366-1-git-send-email-dkg@fifthhorseman.net> <1453258369-7366-5-git-send-email-dkg@fifthhorseman.net> User-Agent: Notmuch/0.21+32~g73439f8 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 24 Jan 2016 15:22:59 -0000 On Wed, Jan 20 2016, Daniel Kahn Gillmor wrote: > Use functions to access the gpg_path for a _notmuch_crypto_t object. > This lets us return sensible defaults based on the state of the user's > machine. > --- > notmuch-reply.c | 13 ++++++++++--- > notmuch-show.c | 12 ++++++++++-- > util/crypto.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- > util/crypto.h | 8 +++++++- > 4 files changed, 75 insertions(+), 7 deletions(-) > > diff --git a/util/crypto.c b/util/crypto.c > index c18c82c..0b51347 100644 > --- a/util/crypto.c > +++ b/util/crypto.c > @@ -21,7 +21,11 @@ > > #include "notmuch.h" > #include "crypto.h" > +#include "search-path.h" > #include > +#include > + > +#define ARRAY_SIZE(arr) (sizeof (arr) / sizeof (arr[0])) > > #define ARRAY_SIZE(arr) (sizeof (arr) / sizeof (arr[0])) duplicate ARRAY_SIZE definition ? > > @@ -38,7 +42,7 @@ get_gpg_context (_notmuch_crypto_t *crypto, GMimeCryptoContext **ctx) > } > > /* TODO: GMimePasswordRequestFunc */ > - crypto->gpgctx = g_mime_gpg_context_new (NULL, crypto->gpgpath ? crypto->gpgpath : "gpg"); > + crypto->gpgctx = g_mime_gpg_context_new (NULL, _notmuch_crypto_get_gpg_path(crypto)); > if (! crypto->gpgctx) {