From ce14139c0f94b99c8c47192620b0a9faf66a96a2 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 8 Nov 2012 09:30:51 -0500 Subject: revert old zsh fix (revno 697) --- tools/Z99-cloud-locale-test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/Z99-cloud-locale-test.sh b/tools/Z99-cloud-locale-test.sh index 4012beeb..8ad485e8 100755 --- a/tools/Z99-cloud-locale-test.sh +++ b/tools/Z99-cloud-locale-test.sh @@ -22,7 +22,7 @@ locale_warn() { case "$w1" in locale:) bad_names="${bad_names} ${w4}";; *) - key=${w1%%\=*} + key=${w1%%=*} val=${w1#*=} val=${val#\"} val=${val%\"} @@ -31,7 +31,7 @@ locale_warn() { done for bad in $bad_names; do for var in ${vars}; do - [ "${bad}" = "${var%\=*}" ] || continue + [ "${bad}" = "${var%=*}" ] || continue value=${var#*=} [ "${bad_lcs#* ${value}}" = "${bad_lcs}" ] && bad_lcs="${bad_lcs} ${value}" -- cgit v1.2.3 From 380bd3f3417c640191bdf90f6622f8bbbe12b5c7 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 8 Nov 2012 09:31:11 -0500 Subject: remove unused variable 'cr'. fix usage of 'value' to local 'val' --- tools/Z99-cloud-locale-test.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/Z99-cloud-locale-test.sh b/tools/Z99-cloud-locale-test.sh index 8ad485e8..97c92166 100755 --- a/tools/Z99-cloud-locale-test.sh +++ b/tools/Z99-cloud-locale-test.sh @@ -10,9 +10,7 @@ # locale_warn() { - local cr=" -" - local bad_names="" bad_lcs="" key="" value="" var="" + local bad_names="" bad_lcs="" key="" val="" var="" vars="" local w1 w2 w3 w4 remain # locale is expected to output either: # VARIABLE= @@ -32,9 +30,9 @@ locale_warn() { for bad in $bad_names; do for var in ${vars}; do [ "${bad}" = "${var%=*}" ] || continue - value=${var#*=} - [ "${bad_lcs#* ${value}}" = "${bad_lcs}" ] && - bad_lcs="${bad_lcs} ${value}" + val=${var#*=} + [ "${bad_lcs#* ${val}}" = "${bad_lcs}" ] && + bad_lcs="${bad_lcs} ${val}" break done done -- cgit v1.2.3 From 956e94d16ab9c94471d3829424e8bd5183f3a735 Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 8 Nov 2012 09:31:26 -0500 Subject: 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. --- tools/Z99-cloud-locale-test.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/Z99-cloud-locale-test.sh b/tools/Z99-cloud-locale-test.sh index 97c92166..3c51f22d 100755 --- a/tools/Z99-cloud-locale-test.sh +++ b/tools/Z99-cloud-locale-test.sh @@ -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" -- cgit v1.2.3