From 8e1b95c201ac5d4a1aa3bae41f17c4d455445298 Mon Sep 17 00:00:00 2001 From: qontinuum-dev <79641156+qontinuum-dev@users.noreply.github.com> Date: Sun, 15 Aug 2021 19:48:56 +0200 Subject: [PATCH] Check if lang is NULL and use shorter check --- src/login.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/login.c b/src/login.c index 57219ae..06e9216 100644 --- a/src/login.c +++ b/src/login.c @@ -212,22 +212,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 : "en_US.UTF-8, 1); // Set PATH if specified in the configuration if (strlen(config.path))