mirror of
https://github.com/fairyglade/ly
synced 2024-11-16 00:12:58 +00:00
Check if lang is NULL and use shorter check (#303)
This commit is contained in:
parent
1890da4799
commit
da5b08abf2
14
src/login.c
14
src/login.c
@ -213,22 +213,14 @@ void env_init(struct passwd* pwd)
|
||||
char* lang = getenv("LANG");
|
||||
// clean env
|
||||
environ[0] = NULL;
|
||||
|
||||
if (term != NULL)
|
||||
{
|
||||
setenv("TERM", term, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
setenv("TERM", "linux", 1);
|
||||
}
|
||||
|
||||
|
||||
setenv("TERM", term ? term : "linux", 1);
|
||||
setenv("HOME", pwd->pw_dir, 1);
|
||||
setenv("PWD", pwd->pw_dir, 1);
|
||||
setenv("SHELL", pwd->pw_shell, 1);
|
||||
setenv("USER", pwd->pw_name, 1);
|
||||
setenv("LOGNAME", pwd->pw_name, 1);
|
||||
setenv("LANG", lang, 1);
|
||||
setenv("LANG", lang ? lang : "C", 1);
|
||||
|
||||
// Set PATH if specified in the configuration
|
||||
if (strlen(config.path))
|
||||
|
Loading…
Reference in New Issue
Block a user