From b1a939f2506b8faa4f283f743f59f88014fa5b32 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Wed, 26 Feb 2014 13:18:58 -0500 Subject: lib/locale.sh: Improve [ cmds with unset vars. --- (limited to 'lib') diff --git a/lib/locale.sh b/lib/locale.sh index 103e734..1ac543b 100644 --- a/lib/locale.sh +++ b/lib/locale.sh @@ -29,10 +29,10 @@ _OH_LOCALE_PATH='@@LOCALEDIR@@/%s/LC_MESSAGES/%s.ms' oh_load_locale() { # Make sure LC_MESSAGES is set. - if [ -z "${LC_MESSAGES}" ]; then - if [ -n "${LC_ALL}" ]; then + if [ "x${LC_MESSAGES+set}" != 'xset' ]; then + if [ "x${LC_ALL+set}" = 'xset' ]; then LC_MESSAGES="${LC_ALL}" - elif [ -n "${LANG}" ]; then + elif [ "x${LANG+set}" = 'xset' ]; then LC_MESSAGES="${LANG}" else LC_MESSAGES="${_OH_DEFAULT_LOCALE}" -- cgit v0.9.1