mirror of
https://github.com/tmux/tmux.git
synced 2025-01-13 03:48:51 +00:00
Use home from struct passwd if HOME is empty as well as if it is NULL, and fix
a style nit. Both from Tiago Cunha.
This commit is contained in:
parent
58688c48aa
commit
9b9d26f80e
@ -332,7 +332,7 @@ cmd_string_expand_tilde(const char *s, size_t *p)
|
||||
|
||||
home = NULL;
|
||||
if (cmd_string_getc(s, p) == '/') {
|
||||
if ((home = getenv("HOME")) == NULL) {
|
||||
if ((home = getenv("HOME")) == NULL || *home == '\0') {
|
||||
if ((pw = getpwuid(getuid())) != NULL)
|
||||
home = pw->pw_dir;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user