X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-config.c;h=bf77cc9d43831460c63625a8fcef47a9f6464612;hp=1cba2661d99d54276b0c6b6c5c2ee9954eb94359;hb=refs%2Fheads%2Fdebian%2Fstretch-backports;hpb=7ac96b149f5a0e5c03b64856d7c20789dab3c628 diff --git a/notmuch-config.c b/notmuch-config.c index 1cba2661..bf77cc9d 100644 --- a/notmuch-config.c +++ b/notmuch-config.c @@ -660,7 +660,19 @@ _config_set_list (notmuch_config_t *config, const char * notmuch_config_get_database_path (notmuch_config_t *config) { - return _config_get (config, &config->database_path, "database", "path"); + char *db_path = (char *)_config_get (config, &config->database_path, "database", "path"); + + if (db_path && *db_path != '/') { + /* If the path in the configuration file begins with any + * character other than /, presume that it is relative to + * $HOME and update as appropriate. + */ + char *abs_path = talloc_asprintf (config, "%s/%s", getenv ("HOME"), db_path); + talloc_free (db_path); + db_path = config->database_path = abs_path; + } + + return db_path; } void @@ -813,7 +825,7 @@ static bool _stored_in_db (const char *item) { const char * db_configs[] = { - "index.try_decrypt", + "index.decrypt", }; if (STRNCMP_LITERAL (item, "query.") == 0) return true;