From 008489c1b2da8999ce10c0edae2808d90eedce67 Mon Sep 17 00:00:00 2001 From: Antti Kantee Date: Wed, 21 Oct 2015 00:26:41 +0000 Subject: [PATCH] Allow config entries in nested objects. --- lib/librumprun_base/config.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/librumprun_base/config.c b/lib/librumprun_base/config.c index 05f921b..0c98299 100644 --- a/lib/librumprun_base/config.c +++ b/lib/librumprun_base/config.c @@ -793,7 +793,14 @@ rumprun_config(char *cmdline) T_CHECKTYPE(tokens, cmdline, JSMN_OBJECT, __func__); - for (t = &tokens[1]; t < &tokens[ntok]; ) { + for (t = &tokens[0]; t < &tokens[ntok]; ) { + /* allow multiple levels of object nesting */ + if (t->type == JSMN_OBJECT) { + t++; + continue; + } + + T_CHECKTYPE(t, cmdline, JSMN_STRING, __func__); for (i = 0; i < __arraycount(parsers); i++) { if (T_STREQ(t, cmdline, parsers[i].name)) { int left; -- 2.39.5