jshn: fix invalid variable reuse
This commit is contained in:
parent
cc2457aa3e
commit
11079ba582
1 changed files with 2 additions and 1 deletions
|
@ -30,6 +30,8 @@ json_add_table() {
|
||||||
jshn_append JSON_STACK "$JSON_CUR"
|
jshn_append JSON_STACK "$JSON_CUR"
|
||||||
local table="JSON_TABLE$JSON_SEQ"
|
local table="JSON_TABLE$JSON_SEQ"
|
||||||
export -- "UP_$table=$JSON_CUR"
|
export -- "UP_$table=$JSON_CUR"
|
||||||
|
export -- "KEYS_$table="
|
||||||
|
jshn_append JSON_UNSET "KEYS_$table UP_$table"
|
||||||
JSON_CUR="$table"
|
JSON_CUR="$table"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,7 +43,6 @@ json_add_object() {
|
||||||
|
|
||||||
json_close_object() {
|
json_close_object() {
|
||||||
local oldstack="$JSON_STACK"
|
local oldstack="$JSON_STACK"
|
||||||
export "KEYS_${JSON_CUR}"
|
|
||||||
JSON_CUR="${JSON_STACK##* }"
|
JSON_CUR="${JSON_STACK##* }"
|
||||||
JSON_STACK="${JSON_STACK% *}"
|
JSON_STACK="${JSON_STACK% *}"
|
||||||
[[ "$oldstack" == "$JSON_STACK" ]] && JSON_STACK=
|
[[ "$oldstack" == "$JSON_STACK" ]] && JSON_STACK=
|
||||||
|
|
Loading…
Reference in a new issue