From 733dae68cf2cd5e3e73507a712e0d6ecf4ed21a9 Mon Sep 17 00:00:00 2001 From: Bart Van Der Meerssche Date: Wed, 11 May 2011 23:53:03 +0200 Subject: [PATCH] [lua] patch for adding a table.create method to Lua core --- .../openwrt/patches/600-lua-tablecreate.patch | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 mote/v2/openwrt/patches/600-lua-tablecreate.patch diff --git a/mote/v2/openwrt/patches/600-lua-tablecreate.patch b/mote/v2/openwrt/patches/600-lua-tablecreate.patch new file mode 100644 index 0000000..8b7dff7 --- /dev/null +++ b/mote/v2/openwrt/patches/600-lua-tablecreate.patch @@ -0,0 +1,24 @@ +--- a/src/ltablib.c 2008-02-14 17:46:58.000000000 +0100 ++++ b/src/ltablib.c 2011-05-01 13:27:24.599067003 +0200 +@@ -265,6 +265,13 @@ + + /* }====================================================== */ + ++static int create (lua_State *L) { ++ int narr, nrec; ++ narr = luaL_optint(L, 1, 0); ++ nrec = luaL_optint(L, 2, 0); ++ lua_createtable(L, narr, nrec); ++ return 1; ++} + + static const luaL_Reg tab_funcs[] = { + {"concat", tconcat}, +@@ -276,6 +283,7 @@ + {"remove", tremove}, + {"setn", setn}, + {"sort", sort}, ++ {"create", create}, + {NULL, NULL} + }; +