aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHadriel Kaplan <hadrielk@yahoo.com>2015-07-12 22:02:17 -0400
committerHadriel Kaplan <hadrielk@yahoo.com>2015-07-13 04:23:02 +0000
commit00b34f45ca7308a87fc765b26936fcdf9b980d0e (patch)
tree2c4b5d5def45d40ef1899a8112e959bec5015204
parenta8f3b3d3d93908b92f68e75a50426c71c581d906 (diff)
Lua: all protocol tree entries expand/contract together
Make each Lua Proto object have an alloacted ett value, so that they expand/contract only for the same protocol. Bug: 11356 Change-Id: I68fb3ff00e080b47d540344aba2554e392b7f1c4 Reviewed-on: https://code.wireshark.org/review/9611 Petri-Dish: Hadriel Kaplan <hadrielk@yahoo.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Hadriel Kaplan <hadrielk@yahoo.com>
-rw-r--r--epan/wslua/wslua_proto.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/epan/wslua/wslua_proto.c b/epan/wslua/wslua_proto.c
index fc9a6ad76c..8fbb2a23b6 100644
--- a/epan/wslua/wslua_proto.c
+++ b/epan/wslua/wslua_proto.c
@@ -569,10 +569,14 @@ int Proto_commit(lua_State* L) {
GArray* hfa = g_array_new(TRUE,TRUE,sizeof(hf_register_info));
GArray* etta = g_array_new(TRUE,TRUE,sizeof(gint*));
GArray* eia = g_array_new(TRUE,TRUE,sizeof(ei_register_info));
+ gint* ettp = NULL;
Proto proto;
/* const gchar* proto_name = lua_tostring(L,2); */
proto = checkProto(L,3);
+ ettp = &(proto->ett);
+ g_array_append_val(etta,ettp);
+
/* get the Lua table of ProtoFields, push it on the stack (index=3) */
lua_rawgeti(L, LUA_REGISTRYINDEX, proto->fields);
@@ -580,7 +584,7 @@ int Proto_commit(lua_State* L) {
for (lua_pushnil(L); lua_next(L, 4); lua_pop(L, 1)) {
ProtoField f = checkProtoField(L,6);
hf_register_info hfri = { NULL, { NULL, NULL, FT_NONE, 0, NULL, 0, NULL, HFILL } };
- gint* ettp = &(f->ett);
+ ettp = &(f->ett);
hfri.p_id = &(f->hfid);
hfri.hfinfo.name = f->name;