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>2012-05-17 16:29:59 +0400
committerFelix Fietkau <nbd@openwrt.org>2012-05-17 16:30:00 +0400
commit94ff2a0abb2938dc84cc46e513f0d039cacbe40a (patch)
tree22cc1ac37c0a68ca53bcacb53657790e80069580 /sh
parent592f2dbd82c6cb9f85332c8056eed58374ac6dd0 (diff)
sh/jshn.sh: fix allowing numbers in identifiers
json_add_generic() needs to handle them as well
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 7228adf..7f922c4 100644
--- a/sh/jshn.sh
+++ b/sh/jshn.sh
@@ -24,7 +24,7 @@ json_add_generic() {
var=$(( ${aseq:-0} + 1 ))
export -- "SEQ_$cur=$var"
else
- local name="$(echo -n "$var" | tr -C '[a-zA-Z_]' _)"
+ local name="$(echo -n "$var" | tr -C '[a-zA-Z0-9_]' _)"
[[ "$name" == "$var" ]] || export -- "NAME_${cur}_${name}=$var"
var="$name"
fi