diff options
author | Dave Reisner <dreisner@archlinux.org> | 2012-04-28 20:10:01 -0400 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2012-04-28 20:10:01 -0400 |
commit | 4d6178953060b79af0b2aa14d36c972989662d35 (patch) | |
tree | 32d78c7f9ef6c04f4706f9277e913d53174320cd /locale.sh | |
parent | fa168b92773d44cb97cff05a47c53ed899315120 (diff) | |
download | initscripts-4d6178953060b79af0b2aa14d36c972989662d35.tar.xz |
locale.sh: try harder to ensure locale is set
If LANG is never set by /etc/locale.conf or /etc/rc.conf, ensure that we
fall back on LANG=C.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Diffstat (limited to 'locale.sh')
-rw-r--r-- | locale.sh | 12 |
1 files changed, 4 insertions, 8 deletions
@@ -4,16 +4,12 @@ if [ -s /etc/locale.conf ]; then . /etc/locale.conf fi -if [ -n "$LANG" ]; then - export LANG -else - if [ -s /etc/rc.conf ]; then - export LANG=$(. /etc/rc.conf 2> /dev/null ; echo "$LOCALE") - else - export LANG="C" - fi +if [ -z "$LANG" ] && [ -s /etc/rc.conf ]; then + LANG=$(. /etc/rc.conf 2>/dev/null; echo "$LOCALE") fi +export LANG=${LANG:-C} + if [ -n "$LC_CTYPE" ]; then export LC_CTYPE else |