mirror of https://github.com/fairyglade/ly.git
login.c: Do not clear the environment upon init
Signed-off-by: Roosembert Palacios <roosembert.palacios@epfl.ch>
This commit is contained in:
parent
3fd81b5f6d
commit
520a2097fd
11
src/login.c
11
src/login.c
|
|
@ -207,17 +207,9 @@ void pam_diagnose(int error, struct term_buf* buf)
|
|||
|
||||
void env_init(struct passwd* pwd, const char* display_name)
|
||||
{
|
||||
extern char** environ;
|
||||
char* term = getenv("TERM");
|
||||
char* lang = getenv("LANG");
|
||||
// clean env
|
||||
environ[0] = NULL;
|
||||
|
||||
if (term != NULL)
|
||||
{
|
||||
setenv("TERM", term, 1);
|
||||
}
|
||||
else
|
||||
if (term == NULL)
|
||||
{
|
||||
setenv("TERM", "linux", 1);
|
||||
}
|
||||
|
|
@ -228,7 +220,6 @@ void env_init(struct passwd* pwd, const char* display_name)
|
|||
setenv("USER", pwd->pw_name, 1);
|
||||
setenv("LOGNAME", pwd->pw_name, 1);
|
||||
setenv("DISPLAY", display_name, 1);
|
||||
setenv("LANG", lang, 1);
|
||||
|
||||
// Set PATH if specified in the configuration
|
||||
if (strlen(config.path))
|
||||
|
|
|
|||
Loading…
Reference in New Issue