aboutsummaryrefslogtreecommitdiff
path: root/lib/open.cc
diff options
context:
space:
mode:
authorDavid Bremner <david@tethera.net>2021-09-30 15:59:54 -0300
committerDavid Bremner <david@tethera.net>2021-12-04 12:17:09 -0400
commit18cdd21b8b2ef056062700607eade43909c32cd2 (patch)
tree9aa1d32d40c23c74794c998bfa8cdcb93f4558c9 /lib/open.cc
parent482bd3a46de34c5f6c5cae3696fd56ffdadc6299 (diff)
lib/config: use g_key_file_get_string to read config values
Unlike the previous g_key_file_get_value, this version processes escape codes for whitespace and \. The remaining two broken tests from the last commit are because "notmuch config get" treats every value as a list, and thus the previously introduces stripping of leading whitespace applies.
Diffstat (limited to 'lib/open.cc')
-rw-r--r--lib/open.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/open.cc b/lib/open.cc
index c2cb2818..a91d22ef 100644
--- a/lib/open.cc
+++ b/lib/open.cc
@@ -198,7 +198,7 @@ _choose_database_path (void *ctx,
}
if (! *database_path && key_file) {
- char *path = g_key_file_get_value (key_file, "database", "path", NULL);
+ char *path = g_key_file_get_string (key_file, "database", "path", NULL);
if (path) {
if (path[0] == '/')
*database_path = talloc_strdup (ctx, path);
@@ -642,7 +642,7 @@ notmuch_database_create_with_config (const char *database_path,
if (key_file && ! split) {
char *mail_root = notmuch_canonicalize_file_name (
- g_key_file_get_value (key_file, "database", "mail_root", NULL));
+ g_key_file_get_string (key_file, "database", "mail_root", NULL));
char *db_path = notmuch_canonicalize_file_name (database_path);
split = (mail_root && (0 != strcmp (mail_root, db_path)));