From fb8fb7b22dd09ba2679361fb3ca93495890d318f Mon Sep 17 00:00:00 2001 From: xelantro <40129767+xelantro@users.noreply.github.com> Date: Mon, 12 Feb 2024 23:12:46 +0000 Subject: [PATCH] Only set envvar if it was already set --- src/login.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/login.c b/src/login.c index ece1ee6..20bc2aa 100644 --- a/src/login.c +++ b/src/login.c @@ -220,8 +220,12 @@ void env_init(struct passwd* pwd) setenv("SHELL", pwd->pw_shell, 1); setenv("USER", pwd->pw_name, 1); setenv("LOGNAME", pwd->pw_name, 1); - setenv("LANG", lang ? lang : "C", 1); + if (lang) + { + setenv("LANG", lang, 1); + } + // Set PATH if specified in the configuration if (strlen(config.path)) {