From 9eaa61109e034327e1923476595a62fe4da22faa Mon Sep 17 00:00:00 2001 From: Hadriel Kaplan Date: Tue, 4 Feb 2014 00:45:45 -0500 Subject: Fix bug 9720 'Lua: bitop library is missing in Lua 5.2' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In Lua 5.2 the bitop library is missing - it's not getting loaded into the lua global table as "bit", or anything else for that matter. Lua 5.2 has its own bit-operations library ("bit32") which is there, but that one's not as good as bitop and would break back/forward compatibility for lua scripts anyway. Change-Id: I94b7d45bbeb2f637d1c76b0b5c9d8472eebfcaea Reviewed-on: https://code.wireshark.org/review/100 Reviewed-by: Evan Huus Tested-by: Evan Huus Reviewed-by: Stig Bjørlykke --- epan/wslua/lua_bitop.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'epan') diff --git a/epan/wslua/lua_bitop.c b/epan/wslua/lua_bitop.c index b20b575325..2b72082f37 100644 --- a/epan/wslua/lua_bitop.c +++ b/epan/wslua/lua_bitop.c @@ -183,9 +183,11 @@ LUALIB_API int luaopen_bit(lua_State *L) } #if LUA_VERSION_NUM < 502 luaL_register(L, "bit", bit_funcs); + return 1; #else luaL_newlib(L, bit_funcs); + lua_setglobal(L, "bit"); /* added for wireshark */ + return 0; /* changed from 1 to 0 for wireshark, since lua_setglobal now pops the table */ #endif - return 1; } -- cgit v1.2.3