diff options
author | Peter Stephenson <p.w.stephenson@ntlworld.com> | 2013-05-04 16:07:34 +0100 |
---|---|---|
committer | Peter Stephenson <p.w.stephenson@ntlworld.com> | 2013-05-04 16:07:34 +0100 |
commit | 60e41f9fc8de1413ae6f0e16d9e7049772089b15 (patch) | |
tree | 0362764371f172b94ff4d0c124a634e7baaef97f | |
parent | 4e43360261e88346bd71b238f423cbf5bc8e1eff (diff) | |
download | zsh-60e41f9fc8de1413ae6f0e16d9e7049772089b15.tar.gz zsh-60e41f9fc8de1413ae6f0e16d9e7049772089b15.tar.xz zsh-60e41f9fc8de1413ae6f0e16d9e7049772089b15.zip |
31369: set locale for completion if locale command is not usable
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | Completion/Base/Utility/_comp_locale | 13 |
2 files changed, 15 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog index 10c17d8b5..f5468b161 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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) diff --git a/Completion/Base/Utility/_comp_locale b/Completion/Base/Utility/_comp_locale index 19870435a..e55338b97 100644 --- a/Completion/Base/Utility/_comp_locale +++ b/Completion/Base/Utility/_comp_locale @@ -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 |