X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-config.c;h=959410cce7b81b95a29969b67f41840610dc9f12;hp=b202bb1e229988f21b2807e49b0c62c60cf5991e;hb=80aeaf7f59e250f034ecc99aa7fcd1e6dd14d9bb;hpb=b15b96f846dcfabbd0c7f43e741573cfd14ab3c8 diff --git a/notmuch-config.c b/notmuch-config.c index b202bb1e..959410cc 100644 --- a/notmuch-config.c +++ b/notmuch-config.c @@ -322,7 +322,7 @@ out: notmuch_config_t * notmuch_config_open (void *ctx, const char *filename, - notmuch_bool_t create_new) + notmuch_config_mode_t config_mode) { GError *error = NULL; size_t tmp; @@ -356,9 +356,13 @@ notmuch_config_open (void *ctx, config->key_file = g_key_file_new (); - if (! get_config_from_file (config, create_new)) { - talloc_free (config); - return NULL; + if (config_mode & NOTMUCH_CONFIG_OPEN) { + notmuch_bool_t create_new = (config_mode & NOTMUCH_CONFIG_CREATE) != 0; + + if (! get_config_from_file (config, create_new)) { + talloc_free (config); + return NULL; + } } /* Whenever we know of configuration sections that don't appear in