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

Yousong Zhou yszhou4tech at gmail.com
Sat Mar 7 10:17:45 EST 2015


Signed-off-by: Yousong Zhou <yszhou4tech at gmail.com>
---
 lua/uci.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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;
 }
-- 
1.7.10.4
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list