work with zsh by using 'emulate -L sh'.

This makes zsh act like 'sh', but only for the function local function.
This way, we do not affect the user's shell, but get the behavior we
want.
This commit is contained in:
Scott Moser 2012-11-08 09:31:26 -05:00
parent 5cd1fc4868
commit 2ce165241b
1 changed files with 5 additions and 0 deletions

View File

@ -12,6 +12,11 @@
locale_warn() {
local bad_names="" bad_lcs="" key="" val="" var="" vars=""
local w1 w2 w3 w4 remain
# if shell is zsh, act like sh only for this function (-L).
# The behavior change will not permenently affect user's shell.
[ "${ZSH_NAME+zsh}" = "zsh" ] && emulate -L sh
# locale is expected to output either:
# VARIABLE=
# VARIABLE="value"