Remove now unused usershell()

This commit is contained in:
Kim Woelders 2022-02-15 15:21:05 +01:00
parent 5ee83dc874
commit bd8433bdfc
2 changed files with 2 additions and 18 deletions

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2012-2015 Kim Woelders
* Copyright (C) 2012-2022 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@ -35,7 +35,6 @@
static int usr_uid = -1;
static const char *usr_name = "unknown";
static const char *usr_home = "/tmp";
static const char *usr_shell = "/bin/sh";
static void
_user_init(void)
@ -60,12 +59,6 @@ _user_init(void)
ss = Estrdup(pwd->pw_dir);
if (ss)
usr_home = ss;
if (canexec(pwd->pw_shell))
{
ss = Estrdup(pwd->pw_shell);
if (ss)
usr_shell = ss;
}
}
const char *
@ -83,11 +76,3 @@ userhome(void)
_user_init();
return usr_home;
}
const char *
usershell(void)
{
if (usr_uid < 0)
_user_init();
return usr_shell;
}

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2000-2007 Carsten Haitzler, Geoff Harrison and various contributors
* Copyright (C) 2012 Kim Woelders
* Copyright (C) 2012-2022 Kim Woelders
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
@ -26,6 +26,5 @@
const char *username(void);
const char *userhome(void);
const char *usershell(void);
#endif /* _USER_H_ */