sh/jshn.sh: fix allowing numbers in identifiers
json_add_generic() needs to handle them as well
This commit is contained in:
parent
592f2dbd82
commit
94ff2a0abb
1 changed files with 1 additions and 1 deletions
|
@ -24,7 +24,7 @@ json_add_generic() {
|
||||||
var=$(( ${aseq:-0} + 1 ))
|
var=$(( ${aseq:-0} + 1 ))
|
||||||
export -- "SEQ_$cur=$var"
|
export -- "SEQ_$cur=$var"
|
||||||
else
|
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"
|
[[ "$name" == "$var" ]] || export -- "NAME_${cur}_${name}=$var"
|
||||||
var="$name"
|
var="$name"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue