libbb/login/su: do not sanitize shell name twice

function                                             old     new   delta
setup_environment                                    191     205     +14
login_main                                          1002     987     -15
su_main                                              474     458     -16
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/2 up/down: 14/-31)            Total: -17 bytes

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2011-03-06 18:49:40 +01:00
parent 41478ade4f
commit bd74e3d8be
3 changed files with 7 additions and 14 deletions

View File

@@ -32,6 +32,9 @@
void FAST_FUNC setup_environment(const char *shell, int flags, const struct passwd *pw)
{
if (!shell || !shell[0])
shell = DEFAULT_SHELL;
/* Change the current working directory to be the home directory
* of the user */
if (chdir(pw->pw_dir)) {