sh/jshn.sh - json_cleanup() dont pollute env with local vars
authorBastian Bittorf <bittorf@bluebottle.com>
Sun, 20 Apr 2014 20:55:48 +0000 (22:55 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 26 Apr 2014 19:30:33 +0000 (21:30 +0200)
this script is mostly sourced, so we should try to keep the pollution
of the users environment as low as possible. make the var 'tmp' local

Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com>
sh/jshn.sh

index b3cd43c..06ba965 100644 (file)
@@ -103,7 +103,7 @@ json_set_namespace() {
 }
 
 json_cleanup() {
 }
 
 json_cleanup() {
-       local unset
+       local unset tmp
 
        _json_get_var unset JSON_UNSET
        for tmp in $unset JSON_VAR; do
 
        _json_get_var unset JSON_UNSET
        for tmp in $unset JSON_VAR; do