mirror of
https://git.notmuchmail.org/git/notmuch
synced 2025-03-18 21:45:17 +01:00
config: read user.name from $NAME if set
Try to read the config parameter user.name from $NAME before taking the user name from /etc/passwd.
This commit is contained in:
parent
a5a47dab87
commit
488b261964
1 changed files with 5 additions and 2 deletions
|
@ -219,7 +219,8 @@ get_username_from_passwd_file (void *ctx)
|
||||||
*
|
*
|
||||||
* database_path: $HOME/mail
|
* database_path: $HOME/mail
|
||||||
*
|
*
|
||||||
* user_name: From /etc/passwd
|
* user_name: $NAME variable if set, otherwise
|
||||||
|
* read from /etc/passwd
|
||||||
*
|
*
|
||||||
* user_primary_mail: $EMAIL variable if set, otherwise
|
* user_primary_mail: $EMAIL variable if set, otherwise
|
||||||
* constructed from the username and
|
* constructed from the username and
|
||||||
|
@ -329,7 +330,9 @@ notmuch_config_open (void *ctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (notmuch_config_get_user_name (config) == NULL) {
|
if (notmuch_config_get_user_name (config) == NULL) {
|
||||||
char *name = get_name_from_passwd_file (config);
|
char *name = getenv ("NAME");
|
||||||
|
if (! name)
|
||||||
|
name = get_name_from_passwd_file (config);
|
||||||
notmuch_config_set_user_name (config, name);
|
notmuch_config_set_user_name (config, name);
|
||||||
talloc_free (name);
|
talloc_free (name);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue