diff options
author | Felix Fietkau <nbd@openwrt.org> | 2008-11-14 17:52:11 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2008-11-14 17:52:11 +0100 |
commit | 5dc61312c1ffc80e730be0bca0bf780a44c55d51 (patch) | |
tree | cac4672be901b6d8107bfba1e31ba9512032d7fa | |
parent | c79cc497e7b0caa0f9f6a2c978fa9a5f0f097463 (diff) | |
download | uci-5dc61312c1ffc80e730be0bca0bf780a44c55d51.tar.gz |
lua: fix uci.set_listv0.6.4
-rw-r--r-- | lua/uci.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -476,12 +476,8 @@ uci_lua_set(lua_State *L) goto error; } - err = uci_set(ctx, &ptr); - if (err) - goto error; - if (istable) { - for (i = 2; i <= lua_objlen(L, nargs); i++) { + for (i = 1; i <= lua_objlen(L, nargs); i++) { lua_rawgeti(L, nargs, i); ptr.value = luaL_checkstring(L, -1); err = uci_add_list(ctx, &ptr); @@ -489,8 +485,13 @@ uci_lua_set(lua_State *L) if (err) goto error; } + } else { + err = uci_set(ctx, &ptr); + if (err) + goto error; } + error: return uci_push_status(L, ctx, false); } |