aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Mark Oteiza <mvoteiza@udel.edu>2014-07-21 19:05:12 -0400
committerGravatar David Bremner <david@tethera.net>2014-07-31 07:13:38 -0300
commit6c9721a40700394e4953e26a8191bbb9552ba145 (patch)
tree3a4e271050660cbad379ed318b05dea6285094a3
parent488b2619643de6776e2649d97b480da8db049023 (diff)
config: read database.path from $MAILDIR if set
Try to read the config parameter database.path from $MAILDIR before falling back to $HOME/mail
-rw-r--r--notmuch-config.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/notmuch-config.c b/notmuch-config.c
index 8f1f48d0..88831e27 100644
--- a/notmuch-config.c
+++ b/notmuch-config.c
@@ -217,7 +217,7 @@ get_username_from_passwd_file (void *ctx)
* These default configuration settings are determined as
* follows:
*
- * database_path: $HOME/mail
+ * database_path: $MAILDIR, otherwise $HOME/mail
*
* user_name: $NAME variable if set, otherwise
* read from /etc/passwd
@@ -323,8 +323,10 @@ notmuch_config_open (void *ctx,
if (notmuch_config_get_database_path (config) == NULL) {
- char *path = talloc_asprintf (config, "%s/mail",
- getenv ("HOME"));
+ char *path = getenv ("MAILDIR");
+ if (! path)
+ path = talloc_asprintf (config, "%s/mail",
+ getenv ("HOME"));
notmuch_config_set_database_path (config, path);
talloc_free (path);
}