mirror of https://github.com/fairyglade/ly.git
Fixes segfault when environment does not set LANG
This commit is contained in:
parent
eb496b0db5
commit
2442599486
|
|
@ -227,7 +227,10 @@ void env_init(struct passwd* pwd)
|
||||||
setenv("SHELL", pwd->pw_shell, 1);
|
setenv("SHELL", pwd->pw_shell, 1);
|
||||||
setenv("USER", pwd->pw_name, 1);
|
setenv("USER", pwd->pw_name, 1);
|
||||||
setenv("LOGNAME", pwd->pw_name, 1);
|
setenv("LOGNAME", pwd->pw_name, 1);
|
||||||
setenv("LANG", lang, 1);
|
if (lang != NULL)
|
||||||
|
{
|
||||||
|
setenv("LANG", lang, 1);
|
||||||
|
}
|
||||||
|
|
||||||
// Set PATH if specified in the configuration
|
// Set PATH if specified in the configuration
|
||||||
if (strlen(config.path))
|
if (strlen(config.path))
|
||||||
|
|
@ -677,4 +680,3 @@ void auth(
|
||||||
pam_diagnose(ok, buf);
|
pam_diagnose(ok, buf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue