X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=lib%2Fopen.cc;h=ec0de4c35c1ace550866c2d836cd61e30e50c83c;hb=e3a4abc513d314cf7550d43fdcba458421a2daac;hp=886c1c90bcd89e575596d0cefb4e13d00b6b30a3;hpb=b30a59157d5ba0421c01fa3dc05d238d18738839;p=notmuch diff --git a/lib/open.cc b/lib/open.cc index 886c1c90..ec0de4c3 100644 --- a/lib/open.cc +++ b/lib/open.cc @@ -1,4 +1,6 @@ #include +#include + #include "database-private.h" #include "parse-time-vrp.h" @@ -92,8 +94,8 @@ _choose_hook_dir (notmuch_database_t *notmuch, err = stat (hook_dir, &st); if (err) { if (errno == ENOENT) { - 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); } else { IGNORE_RESULT (asprintf (message, "Error: Cannot stat %s: %s.\n", hook_dir, strerror (errno)));