projects
/
project
/
uci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c79cc49
)
lua: fix uci.set_list
author
Felix Fietkau
<nbd@openwrt.org>
Fri, 14 Nov 2008 16:52:11 +0000
(17:52 +0100)
committer
Felix Fietkau
<nbd@openwrt.org>
Fri, 14 Nov 2008 16:52:11 +0000
(17:52 +0100)
lua/uci.c
patch
|
blob
|
history
diff --git
a/lua/uci.c
b/lua/uci.c
index
2d3b972
..
d9d4ec6
100644
(file)
--- a/
lua/uci.c
+++ b/
lua/uci.c
@@
-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);
}