X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=lib%2Fconfig.cc;h=f61eb63699ce5c0114c18152d54401721efc6c46;hb=fad2e7540bf9309bfb335650ded753e9ed085eff;hp=7a2882dea2360a87ba3bc511c0cdd3c829de20aa;hpb=3eb25c94bd8fe4065d6df6d665ee393cb9a0ad6f;p=notmuch diff --git a/lib/config.cc b/lib/config.cc index 7a2882de..f61eb636 100644 --- a/lib/config.cc +++ b/lib/config.cc @@ -657,6 +657,10 @@ 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); for (key = NOTMUCH_CONFIG_FIRST; key < NOTMUCH_CONFIG_LAST; @@ -666,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 *