X-Git-Url: http://git.archive.openwrt.org/?p=project%2Fuci.git;a=blobdiff_plain;f=lua%2Fuci.c;h=f87ce271adf5982cecc223285defbf5e1e5d8b41;hp=b64c91f2cadeac655170697b664addef69de179e;hb=4dc75cbcd4cbd7f5f7924c4b912c2faea0ec432c;hpb=600ce9acc5efadd699243f889462b982b83052f2;ds=sidebyside diff --git a/lua/uci.c b/lua/uci.c index b64c91f..f87ce27 100644 --- a/lua/uci.c +++ b/lua/uci.c @@ -119,6 +119,7 @@ lookup_args(lua_State *L, struct uci_ptr *ptr, char **buf) goto error; switch (n) { + case 4: case 3: ptr->option = luaL_checkstring(L, 3); /* fall through */ @@ -133,6 +134,7 @@ lookup_args(lua_State *L, struct uci_ptr *ptr, char **buf) goto error; break; default: + luaL_error(L, "invalid argument count"); goto error; } @@ -173,6 +175,8 @@ static void uci_push_section(lua_State *L, struct uci_section *s) struct uci_element *e; lua_newtable(L); + lua_pushboolean(L, s->anonymous); + lua_setfield(L, -2, ".anonymous"); lua_pushstring(L, s->type); lua_setfield(L, -2, ".type"); lua_pushstring(L, s->e.name);