jshn: shorten JSON_VAR to J_V
authorFelix Fietkau <nbd@openwrt.org>
Sun, 23 Nov 2014 19:21:14 +0000 (20:21 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 23 Nov 2014 19:59:49 +0000 (20:59 +0100)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
jshn.c
sh/jshn.sh

diff --git a/jshn.c b/jshn.c
index cd9d402523f2e8c6c5cad9805e65adb7b221399e..431e1b3eb5087bae275870d8dc087f8fd5539fa4 100644 (file)
--- a/jshn.c
+++ b/jshn.c
@@ -260,7 +260,7 @@ static int jshn_format(bool no_newline, bool indent)
        const char *output;
 
        obj = json_object_new_object();
-       jshn_add_objects(obj, "JSON_VAR", false);
+       jshn_add_objects(obj, "J_V", false);
        output = json_object_to_json_string(obj);
        if (indent) {
                blob_buf_init(&b, 0);
index dab40e4fdfcf89a60f2538fbd0e38b2f685feacf..6bf4be29b34482a2828df545408660077f1a017b 100644 (file)
@@ -105,7 +105,7 @@ json_cleanup() {
        local unset tmp
 
        _json_get_var unset JSON_UNSET
-       for tmp in $unset JSON_VAR; do
+       for tmp in $unset J_V; do
                unset \
                        ${JSON_PREFIX}U_$tmp \
                        ${JSON_PREFIX}K_$tmp \
@@ -125,8 +125,8 @@ json_init() {
        json_cleanup
        export -n ${JSON_PREFIX}JSON_SEQ=0
        export -- \
-               ${JSON_PREFIX}JSON_CUR="JSON_VAR" \
-               ${JSON_PREFIX}K_JSON_VAR=
+               ${JSON_PREFIX}JSON_CUR="J_V" \
+               ${JSON_PREFIX}K_J_V=
 }
 
 json_add_object() {
@@ -250,7 +250,7 @@ json_select() {
        local cur
 
        [ -z "$1" ] && {
-               _json_set_var JSON_CUR "JSON_VAR"
+               _json_set_var JSON_CUR "J_V"
                return 0
        }
        [[ "$1" == ".." ]] && {