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:
authorJo-Philipp Wich <jo@mein.io>2018-01-07 17:46:31 +0300
committerJo-Philipp Wich <jo@mein.io>2018-01-07 17:52:24 +0300
commit1c08e80313fd487112c48346889cc57badeef751 (patch)
tree7b691781d2f00e0d94d49b9a4bca66a66d096a0a /sh
parent729f47fd5279f902986457682f8f166c324eafb5 (diff)
jshn: properly support JSON "null" type
Instead of abort parsing, properly deal with "null" values by implementing support for reading and formatting such values. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'sh')
-rw-r--r--sh/jshn.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/sh/jshn.sh b/sh/jshn.sh
index bf76edb..1090814 100644
--- a/sh/jshn.sh
+++ b/sh/jshn.sh
@@ -168,6 +168,12 @@ json_add_double() {
_json_add_generic double "$1" "$2" "$cur"
}
+json_add_null() {
+ local cur
+ _json_get_var cur JSON_CUR
+ _json_add_generic null "$1" "" "$cur"
+}
+
# functions read access to json variables
json_load() {