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:
authorLuka Perkov <luka@openwrt.org>2013-01-04 14:26:08 +0400
committerFelix Fietkau <nbd@openwrt.org>2013-01-04 16:28:08 +0400
commitf1735cd94e55a3547254bd7d5f3c7c8cd79dac59 (patch)
treeabc12ca475e29d500b2ca1ecee23ce22c999a802 /sh
parent17f4e41ecb80f70c14493b4518e6eabec9faff7b (diff)
sanitize json_get_type function
Signed-off-by: Luka Perkov <luka@openwrt.org>
Diffstat (limited to 'sh')
-rw-r--r--sh/jshn.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/sh/jshn.sh b/sh/jshn.sh
index 70c3aa3..1c35711 100644
--- a/sh/jshn.sh
+++ b/sh/jshn.sh
@@ -197,7 +197,7 @@ json_get_type() {
local cur
_json_get_var cur JSON_CUR
- local var="${JSON_PREFIX}TYPE_${cur}_$2"
+ local var="${JSON_PREFIX}TYPE_${cur}_${2//[^a-zA-Z0-9_]/_}"
eval "export -- \"$dest=\${$var}\"; [ -n \"\${$var+x}\" ]"
}