Re: [PATCH v3 04/16] Provide _notmuch_crypto_{set,get}_gpg_path

Subject: Re: [PATCH v3 04/16] Provide _notmuch_crypto_{set,get}_gpg_path

Date: Wed, 10 Feb 2016 11:31:56 -0500

To: David Bremner, Notmuch Mail

Cc:

From: Daniel Kahn Gillmor


On Wed 2016-02-10 06:45:47 -0500, David Bremner wrote:
> Daniel Kahn Gillmor <dkg@fifthhorseman.net> 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.

I've made these changes in my working copy; i'll publish them as part of
v4 soon.

   --dkg

Thread: