mirror of
https://github.com/tmux/tmux.git
synced 2025-01-15 05:09:04 +00:00
endpwent() is not required after getpwuid().
This commit is contained in:
parent
144aed48fa
commit
940e2ae1fd
4
tmux.c
4
tmux.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: tmux.c,v 1.122 2009-05-26 18:30:51 nicm Exp $ */
|
/* $Id: tmux.c,v 1.123 2009-06-01 20:38:59 nicm Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -353,7 +353,6 @@ main(int argc, char **argv)
|
|||||||
pw = getpwuid(getuid());
|
pw = getpwuid(getuid());
|
||||||
if (pw != NULL)
|
if (pw != NULL)
|
||||||
home = pw->pw_dir;
|
home = pw->pw_dir;
|
||||||
endpwent();
|
|
||||||
}
|
}
|
||||||
xasprintf(&cfg_file, "%s/%s", home, DEFAULT_CFG);
|
xasprintf(&cfg_file, "%s/%s", home, DEFAULT_CFG);
|
||||||
if (access(cfg_file, R_OK) != 0) {
|
if (access(cfg_file, R_OK) != 0) {
|
||||||
@ -380,7 +379,6 @@ main(int argc, char **argv)
|
|||||||
pw = getpwuid(getuid());
|
pw = getpwuid(getuid());
|
||||||
if (pw != NULL)
|
if (pw != NULL)
|
||||||
shell = pw->pw_shell;
|
shell = pw->pw_shell;
|
||||||
endpwent();
|
|
||||||
if (shell == NULL || *shell == '\0')
|
if (shell == NULL || *shell == '\0')
|
||||||
shell = _PATH_BSHELL;
|
shell = _PATH_BSHELL;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user