From: Jo-Philipp Wich Date: Wed, 30 May 2012 19:47:43 +0000 (+0200) Subject: sh/jshn.sh: fix json_get_var() and json_get_type() to not return cached values X-Git-Url: http://git.archive.openwrt.org/?p=project%2Flibubox.git;a=commitdiff_plain;h=0608d1299546d4af1facc271a090cb2abb8c6105 sh/jshn.sh: fix json_get_var() and json_get_type() to not return cached values --- diff --git a/sh/jshn.sh b/sh/jshn.sh index a15cb00..0f209d3 100644 --- a/sh/jshn.sh +++ b/sh/jshn.sh @@ -95,13 +95,13 @@ json_dump() { json_get_type() { local dest="$1" local var="TYPE_${JSON_CUR}_$2" - eval "[ -n \"\${$var+x}\" ] && export -- \"$dest=\${$var}\"" + eval "export -- \"$dest=\${$var}\"; [ -n \"\${$var+x}\" ]" } json_get_var() { local dest="$1" local var="${JSON_CUR}_${2//[^a-zA-Z0-9_]/_}" - eval "[ -n \"\${$var+x}\" ] && export -- \"$dest=\${$var}\"" + eval "export -- \"$dest=\${$var}\"; [ -n \"\${$var+x}\" ]" } json_get_vars() {