mirror of
https://github.com/fairyglade/ly.git
synced 2025-12-21 03:34:54 +00:00
Check if lang is NULL and use shorter check (#303)
This commit is contained in:
12
src/login.c
12
src/login.c
@@ -214,21 +214,13 @@ void env_init(struct passwd* pwd)
|
||||
// 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))
|
||||
|
||||
Reference in New Issue
Block a user