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

David Bremner david at tethera.net
Wed Feb 10 03:45:47 PST 2016


Daniel Kahn Gillmor <dkg at 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.




More information about the notmuch mailing list