]> xenbits.xensource.com Git - osstest/rumprun.git/commitdiff
Allow config entries in nested objects.
authorAntti Kantee <pooka@iki.fi>
Wed, 21 Oct 2015 00:26:41 +0000 (00:26 +0000)
committerAntti Kantee <pooka@iki.fi>
Wed, 21 Oct 2015 00:30:08 +0000 (00:30 +0000)
lib/librumprun_base/config.c

index 05f921bbb5658d3c65c92a95b6e9e67438e99602..0c98299f4e4d37aaf1947c99d0c75f5866156c2d 100644 (file)
@@ -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;