diff options
author | Takao Fujiwara <tfujiwar@redhat.com> | 2019-10-22 20:44:04 +0900 |
---|---|---|
committer | Ray Strode <rstrode@redhat.com> | 2020-05-05 16:31:39 -0400 |
commit | 73b9aa3a602606b32c328f5feb3a75dfca848c5a (patch) | |
tree | 2e61a4d1ab2f4f166060471379d927288440771d | |
parent | bb4842dd785dc85bef4c382c391d65700d0b3f64 (diff) | |
download | gnome-session-73b9aa3a602606b32c328f5feb3a75dfca848c5a.tar.gz |
gnome-session: avoid setting LC_ unless LANG and region disagree
At the moment, gnome-session explicitly sets the various LC_ variables
to the user configured region.
That's unnecessary, though. If the LC_ variables are unset,
applications know to use LANG. Furthermore, setting the LC_ variables
makes it so you can't override them with LANG anymore.
This commit makes sure the LC_ variables only get set when absolutely
necesary. That is, when they are different than LANG.
https://gitlab.gnome.org/GNOME/gnome-session/issues/37
-rwxr-xr-x | gnome-session/gnome-session.in | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/gnome-session/gnome-session.in b/gnome-session/gnome-session.in index 7ded3594..edec0ae0 100755 --- a/gnome-session/gnome-session.in +++ b/gnome-session/gnome-session.in @@ -18,11 +18,15 @@ REGION=${SETTING#\'} REGION=${REGION%\'} if [ -n "$REGION" ]; then - export LC_TIME=$REGION - export LC_NUMERIC=$REGION - export LC_MONETARY=$REGION - export LC_MEASUREMENT=$REGION - export LC_PAPER=$REGION + unset LC_TIME LC_NUMERIC LC_MONETARY LC_MEASUREMENT LC_PAPER + + if [ "$LANG" != "$REGION" ] ; then + export LC_TIME=$REGION + export LC_NUMERIC=$REGION + export LC_MONETARY=$REGION + export LC_MEASUREMENT=$REGION + export LC_PAPER=$REGION + fi fi exec @libexecdir@/gnome-session-binary "$@" |