From f40378376d30eb8413ef16b265cd758fc84b0ded Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 9 Dec 2011 03:05:29 +0100 Subject: first check if locale binary exists under openbsd locale is not available, so disable locale handling to avoid errors --- bashrc/common/locale.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'bashrc') diff --git a/bashrc/common/locale.sh b/bashrc/common/locale.sh index b337292..b75b3aa 100644 --- a/bashrc/common/locale.sh +++ b/bashrc/common/locale.sh @@ -2,10 +2,12 @@ eval unset ${!LC_*} LANG -if locale -a | grep "en_US.UTF-8" 2>&1 >/dev/null ; then - export LANG="en_US.UTF-8" -elif locale -a | grep "en_US.utf8" 2>&1 >/dev/null ; then - export LANG="en_US.utf8" +if hash locale 2>&1 >/dev/null ; then + if locale -a | grep "en_US.UTF-8" 2>&1 >/dev/null ; then + export LANG="en_US.UTF-8" + elif locale -a | grep "en_US.utf8" 2>&1 >/dev/null ; then + export LANG="en_US.utf8" + fi fi export LC_COLLATE="C" -- cgit v1.2.3