]> git.cworth.org Git - notmuch/blobdiff - lib/config.cc
lib/open: no default mail root in split configurations
[notmuch] / lib / config.cc
index 8f6ef110788fe174def7c9014ad6be2cba3eff9c..f61eb63699ce5c0114c18152d54401721efc6c46 100644 (file)
@@ -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 *