diff options
author | Jani Nikula <jani@nikula.org> | 2017-02-26 21:12:38 +0200 |
---|---|---|
committer | David Bremner <david@tethera.net> | 2017-02-28 08:08:11 -0400 |
commit | 80aeaf7f59e250f034ecc99aa7fcd1e6dd14d9bb (patch) | |
tree | e7f40b481c73e85985ccf478446460010e3d99e5 /notmuch-config.c | |
parent | 5a69aa14748162429c43ad5ff3d8b35779fff0d4 (diff) |
cli/config: don't try to open config file for 'notmuch help'
The help command does not really need to try to open the config
file. So don't.
Diffstat (limited to 'notmuch-config.c')
-rw-r--r-- | notmuch-config.c | 12 |
1 files changed, 8 insertions, 4 deletions
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 |