- config->is_new = FALSE;
- config->database_path = NULL;
- config->user_name = NULL;
- config->user_primary_email = NULL;
- config->user_other_email = NULL;
- config->user_other_email_length = 0;
- config->new_tags = NULL;
- config->new_tags_length = 0;
- config->new_ignore = NULL;
- config->new_ignore_length = 0;
- config->maildir_synchronize_flags = TRUE;
- config->search_exclude_tags = NULL;
- config->search_exclude_tags_length = 0;
- config->crypto_gpg_path = NULL;
-
- if (! get_config_from_file (config, create_new)) {
- talloc_free (config);
- return NULL;
+ if (config_mode & NOTMUCH_CONFIG_OPEN) {
+ bool create_new = (config_mode & NOTMUCH_CONFIG_CREATE) != 0;
+
+ if (! get_config_from_file (config, create_new)) {
+ talloc_free (config);
+ return NULL;
+ }