# HG changeset patch # User Kim Alvefur # Date 1427412496 -3600 # Node ID 03a43bf3ecd2bce6da11f155d5b0880d94451c43 # Parent 478308ee29ddad1b5cfaed0d5254332c9a9faa46# Parent 61b6a4fc65f1c932477ba3b056f7ff859651cc0e Merge with merge diff -r 61b6a4fc65f1 -r 03a43bf3ecd2 net/http/server.lua diff -r 61b6a4fc65f1 -r 03a43bf3ecd2 util-src/encodings.c --- a/util-src/encodings.c Thu Mar 26 16:48:39 2015 +0000 +++ b/util-src/encodings.c Fri Mar 27 00:28:16 2015 +0100 @@ -452,40 +452,30 @@ /***************** end *****************/ -static const luaL_Reg Reg[] = -{ - { NULL, NULL } -}; - LUALIB_API int luaopen_util_encodings(lua_State *L) { #ifdef USE_STRINGPREP_ICU init_icu(); #endif - luaL_register(L, "encodings", Reg); + lua_newtable(L); - lua_pushliteral(L, "base64"); lua_newtable(L); luaL_register(L, NULL, Reg_base64); - lua_settable(L,-3); + lua_setfield(L, -2, "base64"); - lua_pushliteral(L, "stringprep"); lua_newtable(L); luaL_register(L, NULL, Reg_stringprep); - lua_settable(L,-3); + lua_setfield(L, -2, "stringprep"); - lua_pushliteral(L, "idna"); lua_newtable(L); luaL_register(L, NULL, Reg_idna); - lua_settable(L,-3); + lua_setfield(L, -2, "idna"); - lua_pushliteral(L, "utf8"); lua_newtable(L); luaL_register(L, NULL, Reg_utf8); - lua_settable(L, -3); + lua_setfield(L, -2, "utf8"); - lua_pushliteral(L, "version"); /** version */ lua_pushliteral(L, "-3.14"); - lua_settable(L,-3); + lua_setfield(L, -2, "version"); return 1; }