* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- hook_path = talloc_asprintf (NULL, "%s/%s/%s/%s", db_path, ".notmuch",
- "hooks", hook);
+ hook_path = talloc_asprintf (notmuch, "%s/%s",
+ notmuch_config_get (notmuch, NOTMUCH_CONFIG_HOOK_DIR),
+ hook);
/* 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
/* 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
if (pid == -1) {
fprintf (stderr, "Error: %s hook fork failed: %s\n", hook,
strerror (errno));
if (pid == -1) {
fprintf (stderr, "Error: %s hook fork failed: %s\n", hook,
strerror (errno));
if (WIFEXITED (status)) {
fprintf (stderr, "Error: %s hook failed with status %d\n",
hook, WEXITSTATUS (status));
if (WIFEXITED (status)) {
fprintf (stderr, "Error: %s hook failed with status %d\n",
hook, WEXITSTATUS (status));