]> git.notmuchmail.org Git - notmuch/blobdiff - hooks.c
lib/database: delete stemmer on destroy
[notmuch] / hooks.c
diff --git a/hooks.c b/hooks.c
index 59c5807065fc4ee58974a7eec196c7335bcbb8e3..ec89b22ec75497ee69a5d9cce888c6c2a1a95c81 100644 (file)
--- a/hooks.c
+++ b/hooks.c
 #include <sys/wait.h>
 
 int
-notmuch_run_hook (const char *db_path, const char *hook)
+notmuch_run_hook (notmuch_database_t *notmuch, const char *hook)
 {
     char *hook_path;
     int status = 0;
     pid_t pid;
 
-    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);
     if (hook_path == NULL) {
        fprintf (stderr, "Out of memory\n");
        return 1;