X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-config.c;h=db487dbe828ba808b6c3223a8d33df581864d74f;hp=88831e278f9fbf10b2d30eccf81a44a3052bfc26;hb=ec573cd54fb3ea98f37a3c3612b00fb16e34578b;hpb=6c9721a40700394e4953e26a8191bbb9552ba145 diff --git a/notmuch-config.c b/notmuch-config.c index 88831e27..db487dbe 100644 --- a/notmuch-config.c +++ b/notmuch-config.c @@ -324,7 +324,9 @@ notmuch_config_open (void *ctx, if (notmuch_config_get_database_path (config) == NULL) { char *path = getenv ("MAILDIR"); - if (! path) + if (path) + path = talloc_strdup (config, path); + else path = talloc_asprintf (config, "%s/mail", getenv ("HOME")); notmuch_config_set_database_path (config, path); @@ -333,7 +335,9 @@ notmuch_config_open (void *ctx, if (notmuch_config_get_user_name (config) == NULL) { char *name = getenv ("NAME"); - if (! name) + if (name) + name = talloc_strdup (config, name); + else name = get_name_from_passwd_file (config); notmuch_config_set_user_name (config, name); talloc_free (name);