From 793d4305d3563082761a59ac418ce827d00bdc39 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Fri, 25 Dec 2020 23:22:23 -0400 Subject: lib/open: support NOTMUCH_DATABASE environment variable The additional code is trivial, but making sure we get the priority of various options correct takes a few tests. --- lib/open.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/open.cc b/lib/open.cc index d05a19a7..6e46168a 100644 --- a/lib/open.cc +++ b/lib/open.cc @@ -168,6 +168,10 @@ _choose_database_path (void *ctx, return status; } + if (! *database_path) { + *database_path = getenv ("NOTMUCH_DATABASE"); + } + if (! *database_path && *key_file) { char *path = g_key_file_get_value (*key_file, "database", "path", NULL); if (path) { -- cgit v1.2.3