X-Git-Url: https://git.cworth.org/git?p=notmuch;a=blobdiff_plain;f=hooks.c;fp=hooks.c;h=0cf72e748bc983d60aa09a074375b5fef2c96d97;hp=ec89b22ec75497ee69a5d9cce888c6c2a1a95c81;hb=bfcf9a6c102af9232b6d2e720f919ff1c9b431f8;hpb=e167825bca476403b0371fbdf4c8fbdfb4a6f935 diff --git a/hooks.c b/hooks.c index ec89b22e..0cf72e74 100644 --- a/hooks.c +++ b/hooks.c @@ -27,6 +27,7 @@ int notmuch_run_hook (notmuch_database_t *notmuch, const char *hook) { char *hook_path; + const char *config_path; int status = 0; pid_t pid; @@ -38,6 +39,12 @@ notmuch_run_hook (notmuch_database_t *notmuch, const char *hook) return 1; } + config_path = notmuch_config_path (notmuch); + if (setenv ("NOTMUCH_CONFIG", config_path, 1)) { + perror ("setenv"); + return 1; + } + /* Check access before fork() for speed and simplicity of error handling. */ if (access (hook_path, X_OK) == -1) { /* Ignore ENOENT. It's okay not to have a hook, hook dir, or even