diff mbox

[OpenWrt-Devel,3/3] lua: return module table instead of boolean value on require('uci').

Message ID 1425741466-29090-3-git-send-email-yszhou4tech@gmail.com
State Superseded
Delegated to: Felix Fietkau
Headers show

Commit Message

Yousong Zhou March 7, 2015, 3:17 p.m. UTC
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
---
 lua/uci.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/lua/uci.c b/lua/uci.c
index 8ace746..6ba7da0 100644
--- a/lua/uci.c
+++ b/lua/uci.c
@@ -994,8 +994,9 @@  luaopen_uci(lua_State *L)
 
 	/* create module */
 	lua_newtable(L);
+	lua_pushvalue(L, -1);
 	luaL_setfuncs(L, uci, 0);
 	lua_setglobal(L, MODNAME);
 
-	return 0;
+	return 1;
 }