aboutsummaryrefslogtreecommitdiff
path: root/lib/config.cc
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2021-02-13 13:17:52 -0400
committerDavid Bremner <david@tethera.net>2021-03-27 09:26:14 -0300
commit0c6db22930b58fcea972e71b45f7ea0e6055ed20 (patch)
tree95a5ef2b6d5844c1edb88b73fb8e1eb1545976a0 /lib/config.cc
parent2fc40e24de4fb06428273e6f55ebd72faabde778 (diff)
lib/config: add notmuch_config_get_values_string
This is to support the less common (at least in the notmuch codebase) case of accessing a ;-delimited list config value with an arbitrary string key.
Diffstat (limited to 'lib/config.cc')
-rw-r--r--lib/config.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/config.cc b/lib/config.cc
index 8bd3c35a..24418f98 100644
--- a/lib/config.cc
+++ b/lib/config.cc
@@ -261,13 +261,19 @@ _notmuch_config_load_from_database (notmuch_database_t *notmuch)
notmuch_config_values_t *
notmuch_config_get_values (notmuch_database_t *notmuch, notmuch_config_key_t key)
{
- notmuch_config_values_t *values = NULL;
- bool ok = false;
-
const char *key_str = _notmuch_config_key_to_string (key);
if (! key_str)
- goto DONE;
+ return NULL;
+
+ return notmuch_config_get_values_string (notmuch, key_str);
+}
+
+notmuch_config_values_t *
+notmuch_config_get_values_string (notmuch_database_t *notmuch, const char *key_str)
+{
+ notmuch_config_values_t *values = NULL;
+ bool ok = false;
values = talloc (notmuch, notmuch_config_values_t);
if (unlikely (! values))