[PATCH] lib: load user config. in notmuch_database_open_verbose()

Subject: [PATCH] lib: load user config. in notmuch_database_open_verbose()

Date: Sat, 14 Aug 2021 15:36:47 -0400

To: notmuch@notmuchmail.org

Cc: Austin Ray

From: Austin Ray

Docstring for notmuch_database_open_verbose() states it calls
notmuch_database_open_with_config() with "config_path=NULL"; however,
the implementation uses an empty string. This results in libnotmuch
ignoring the user's configuration and may cause issues in downstream
library consumers.

Signed-off-by: Austin Ray <austin@austinray.io>


NeoMutt has an open bug[0] related to this. The user is using a separate
database and email directory so libnotmuch returns file paths rooted in
the database directory when calling notmuch_database_open_verbose(). If
calling notmuch_database_open_with_config() with "config_path=NULL",
libnotmuch returns the correct file paths.

[0] https://github.com/neomutt/neomutt/issues/3017
 lib/open.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/open.cc b/lib/open.cc
index 7b95c5b1..0d25ba72 100644
--- a/lib/open.cc
+++ b/lib/open.cc
@@ -36,7 +36,7 @@ notmuch_database_open_verbose (const char *path,
 			       notmuch_database_t **database,
 			       char **status_string)
-    return notmuch_database_open_with_config (path, mode, "", NULL,
+    return notmuch_database_open_with_config (path, mode, NULL, NULL,
 					      database, status_string);
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org