Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check if lang is NULL and use shorter check #303

Merged
merged 3 commits into from May 12, 2022
Merged

Check if lang is NULL and use shorter check #303

merged 3 commits into from May 12, 2022

Conversation

ghost
Copy link

@ghost ghost commented Aug 15, 2021

This fixes an issue that causes a problem on non-systemd systems and that is anyway a programming error.
It also uses shorter checks, I would obviously use the same as you if you prefer.

src/login.c Outdated
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);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing closing quote "

i did the same thing for s6/obarun as workaround. though this works, this will likely break other systems that are not using EN locale since LANG and the rest will not be set anymore through /etc/profile, or skips /etc/vconsole.conf. ly has to run after LANG is normally set by system.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the double quote

Concerning the breakage that may occur, I don't see what is the issue with the things you mentionned. The value is just a default and is set in the case LANG is not already set. There is no bypass of the stuff set in /etc/profile and /etc/vconsole.conf using this method, is there?

@sebastka
Copy link

How about this instead? 98c65b3

@nullgemm
Copy link
Collaborator

How about this instead? 98c65b3

I think this is better, can you do this @qontinuum-dev ?

@nullgemm nullgemm added ok This issue or pull request was confirmed/reviewed wip This issue or pull request is a draft labels Apr 24, 2022
@nullgemm nullgemm merged commit da5b08a into fairyglade:master May 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok This issue or pull request was confirmed/reviewed wip This issue or pull request is a draft
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants