mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-22 17:34:54 +01:00
config: read database.path from $MAILDIR if set
Try to read the config parameter database.path from $MAILDIR before falling back to $HOME/mail
This commit is contained in:
parent
488b261964
commit
6c9721a407
1 changed files with 5 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue