# HG changeset patch # User Kim Alvefur # Date 1427412575 -3600 # Node ID 96f4a325b534b75ee1eafde69f02bea1880eb8ee # Parent e702ae7aa3d9c4e0b9d56deeccdc1083528d9651# Parent 03a43bf3ecd2bce6da11f155d5b0880d94451c43 Merge 0.10->trunk diff -r e702ae7aa3d9 -r 96f4a325b534 net/http/server.lua diff -r e702ae7aa3d9 -r 96f4a325b534 util-src/encodings.c --- a/util-src/encodings.c Thu Mar 26 16:49:03 2015 +0000 +++ b/util-src/encodings.c Fri Mar 27 00:29:35 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; }