1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-01-19 11:31:26 +01:00

31369: set locale for completion if locale command is not usable

This commit is contained in:
Peter Stephenson 2013-05-04 16:07:34 +01:00
parent 4e43360261
commit 60e41f9fc8
2 changed files with 15 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2013-05-04 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 31369: Completion/Base/Utility/_comp_locale: action if locale
command is not usable.
2013-04-29 Bart Schaefer <schaefer@zsh.org>
* 31361: Src/init.c: handle negative optno ("no" prefix used)

View file

@ -7,7 +7,14 @@
# This exports new locale settings, so should only
# be run in a subshell. A typical use is in a $(...).
local ctype=${${(f)"$(locale 2>/dev/null)"}:#^LC_CTYPE=*}
unset -m LC_\*
[[ -n $ctype ]] && eval export $ctype
local ctype
if ctype=${${(f)"$(locale 2>/dev/null)"}:#^LC_CTYPE=*}; then
unset -m LC_\*
[[ -n $ctype ]] && eval export $ctype
else
ctype=${LC_ALL:-${LC_CTYPE:-${LANG:-C}}}
unset -m LC_\*
export LC_CTYPE=$ctype
fi
export LANG=C