Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.openwrt.org/project/libubox.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/sh
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-11-23 21:43:56 +0300
committerFelix Fietkau <nbd@openwrt.org>2014-11-23 21:43:56 +0300
commit37b5203e189a8085d815872bccb7df67147a3cf3 (patch)
tree1468f4c79ee2c237b5a7037dab80744644cceaf9 /sh
parentd5d384b0ba390b39fdca07919f3e3831afc712c2 (diff)
jshn: only keep UP_* variables around while they are needed
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'sh')
-rw-r--r--sh/jshn.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/sh/jshn.sh b/sh/jshn.sh
index f5cf1d2..78414f0 100644
--- a/sh/jshn.sh
+++ b/sh/jshn.sh
@@ -92,6 +92,7 @@ _json_close_table() {
_json_get_var _s_cur JSON_CUR
_json_get_var "${JSON_PREFIX}JSON_CUR" "UP_$_s_cur"
+ unset "${JSON_PREFIX}UP_$_s_cur"
}
json_set_namespace() {
@@ -258,6 +259,7 @@ json_select() {
[[ "$1" == ".." ]] && {
_json_get_var cur JSON_CUR
_json_get_var cur "UP_$cur"
+ unset "${JSON_PREFIX}UP_$cur"
_json_set_var JSON_CUR "$cur"
return 0
}
@@ -265,6 +267,7 @@ json_select() {
case "$type" in
object|array)
json_get_var cur "$target"
+ _json_get_var "${JSON_PREFIX}UP_$cur" JSON_CUR
_json_set_var JSON_CUR "$cur"
;;
*)