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 7B3026DE0231 for ; Wed, 10 Feb 2016 03:45:55 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.308 X-Spam-Level: X-Spam-Status: No, score=-0.308 tagged_above=-999 required=5 tests=[AWL=0.243, RP_MATCHES_RCVD=-0.55, SPF_PASS=-0.001] 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 jRYsvYSmZi84 for ; Wed, 10 Feb 2016 03:45:53 -0800 (PST) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 1CDA36DE021E for ; Wed, 10 Feb 2016 03:45:52 -0800 (PST) Received: from remotemail by fethera.tethera.net with local (Exim 4.84) (envelope-from ) id 1aTTCm-00081w-8l; Wed, 10 Feb 2016 06:45:08 -0500 Received: (nullmailer pid 24742 invoked by uid 1000); Wed, 10 Feb 2016 11:45:47 -0000 From: David Bremner To: Daniel Kahn Gillmor , Notmuch Mail Subject: Re: [PATCH v3 04/16] Provide _notmuch_crypto_{set,get}_gpg_path In-Reply-To: <1454272801-23623-5-git-send-email-dkg@fifthhorseman.net> References: <1454272801-23623-1-git-send-email-dkg@fifthhorseman.net> <1454272801-23623-5-git-send-email-dkg@fifthhorseman.net> User-Agent: Notmuch/0.21+5~gca076ce (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Wed, 10 Feb 2016 07:45:47 -0400 Message-ID: <87r3gkvlec.fsf@maritornes.cs.unb.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: Wed, 10 Feb 2016 11:45:55 -0000 Daniel Kahn Gillmor writes: > +#define try_gpg_path(z) if (test_for_executable(z)) return z > + try_gpg_path("gpg2"); > + try_gpg_path("gpg"); > +#undef try_gpg_path > + return NULL; > +} I think I'd prefer just inlining these two ifs. > +notmuch_status_t > +_notmuch_crypto_set_gpg_path (_notmuch_crypto_t *crypto, const char* gpg_path) > +{ > + /* return success if this matches what is already configured */ > + if ((!gpg_path && !crypto->gpg_path) || > + (gpg_path && crypto->gpg_path && 0 == strcmp(gpg_path, crypto->gpg_path))) > + return NOTMUCH_STATUS_SUCCESS; these changes probably need a pass of uncrustify or equivalent.