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>2013-10-30 14:50:39 +0400
committerFelix Fietkau <nbd@openwrt.org>2013-10-30 14:50:39 +0400
commita34c8f6918c291275ded2b6fd9b94ac91722ded2 (patch)
treebf9e66228a053d92f06df49ea91224c4fe4dc73c /sh
parentdcbc14a70169c52dcf76573a6a00268c9359860e (diff)
jshn: refactor _jshn_append to require fewer evals
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'sh')
-rw-r--r--sh/jshn.sh9
1 files changed, 3 insertions, 6 deletions
diff --git a/sh/jshn.sh b/sh/jshn.sh
index a324c54..9e7f444 100644
--- a/sh/jshn.sh
+++ b/sh/jshn.sh
@@ -22,12 +22,9 @@ __jshn_raw_append() {
_jshn_append() {
# var=$1
- # value=$2
- # sep=$3
- local __old_val
-
- _json_get_var __old_val "$1"
- _json_set_var "$1" "${__old_val:+$__old_val${3:- }}$2"
+ local _a_value="$2"
+ local _a_sep="${3:- }"
+ eval "${JSON_PREFIX}$1=\"\${${JSON_PREFIX}$1:+\${${JSON_PREFIX}$1}\${_a_value:+\$_a_sep}}\$_a_value\""
}
_json_export() {