- const char *database_path = notmuch_database_get_path (notmuch);
- hook_dir = talloc_asprintf (notmuch, "%s/.notmuch/hooks", database_path);
+ char *notmuch_path = dirname (talloc_strdup (notmuch, notmuch->xapian_path));
+ hook_dir = talloc_asprintf (notmuch, "%s/hooks", notmuch_path);