aboutsummaryrefslogtreecommitdiff
path: root/locale.sh
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2012-04-28 20:10:01 -0400
committerDave Reisner <dreisner@archlinux.org>2012-04-28 20:10:01 -0400
commit4d6178953060b79af0b2aa14d36c972989662d35 (patch)
tree32d78c7f9ef6c04f4706f9277e913d53174320cd /locale.sh
parentfa168b92773d44cb97cff05a47c53ed899315120 (diff)
downloadinitscripts-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.sh12
1 files changed, 4 insertions, 8 deletions
diff --git a/locale.sh b/locale.sh
index fe82378..c465f6f 100644
--- a/locale.sh
+++ b/locale.sh
@@ -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