aboutsummaryrefslogtreecommitdiff
path: root/lib/config.cc
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2021-12-25 09:33:05 -0400
committerDavid Bremner <david@tethera.net>2022-01-15 15:59:39 -0400
commitfad2e7540bf9309bfb335650ded753e9ed085eff (patch)
treefe2526c42d0a11dc5a336de501e23a991da9c31f /lib/config.cc
parent64212c7b91cdb7e65a2a28f994f8d060a50ae78c (diff)
lib/open: no default mail root in split configurations
If we know the configuration is split, but there is no mail root defined, this indicates a (lack of) configuration error. Currently this can only arise in XDG configurations.
Diffstat (limited to 'lib/config.cc')
-rw-r--r--lib/config.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/config.cc b/lib/config.cc
index 8f6ef110..f61eb636 100644
--- a/lib/config.cc
+++ b/lib/config.cc
@@ -657,6 +657,7 @@ notmuch_status_t
_notmuch_config_load_defaults (notmuch_database_t *notmuch)
{
notmuch_config_key_t key;
+ notmuch_status_t status = NOTMUCH_STATUS_SUCCESS;
if (notmuch->config == NULL)
notmuch->config = _notmuch_string_map_create (notmuch);
@@ -669,11 +670,14 @@ _notmuch_config_load_defaults (notmuch_database_t *notmuch)
val = _notmuch_string_map_get (notmuch->config, key_string);
if (! val) {
+ if (key == NOTMUCH_CONFIG_MAIL_ROOT && (notmuch->params & NOTMUCH_PARAM_SPLIT))
+ status = NOTMUCH_STATUS_NO_MAIL_ROOT;
+
_notmuch_string_map_set (notmuch->config, key_string, _notmuch_config_default (notmuch,
key));
}
}
- return NOTMUCH_STATUS_SUCCESS;
+ return status;
}
const char *