path: root/dfilter.c
diff options
authorGuy Harris <guy@alum.mit.edu>1999-07-11 08:40:52 +0000
committerGuy Harris <guy@alum.mit.edu>1999-07-11 08:40:52 +0000
commitbb0eaf66b754ce5714d271b625cd9697f033ea7a (patch)
treea61fde061a49712c7f84e7260af72fe4262a1381 /dfilter.c
parentd35862ac07fed2f0a12032102c664665e50257f1 (diff)
When you hit <Return> in the text entry box for the display filter,
apply the filter (if it isn't invalid). Apply the filter by clearing the Clist that shows packet summary lines and scanning through the list of all packets and adding to the Clist those that match the filter. Get rid of "if (dfilter_proto_tree)" test in "load_cap_file()"; "dfilter_proto_tree" is always FALSE, and all the test does is keep us from doing a "gtk_clist_freeze()" of the packet list, and we don't want to do that (we don't want the packet to be updated until we're done reading in the file). Get rid of "dfilter_proto_tree", as it's no longer used. Move the test that checks whether the display filter matches the current packet to "add_packet_to_packet_list()"; this allows us to run "dissect_packet()" only once - if we have a display filter, we generate the summary info *and* the protocol tree in the same call, using the summary info to make the packet list item and the protocol tree when checking the display filter. In "dfilter_compile()", destroy "*p_dfcode" if it's not NULL, so we don't leak memory. svn path=/trunk/; revision=355
Diffstat (limited to 'dfilter.c')
1 files changed, 4 insertions, 1 deletions
diff --git a/dfilter.c b/dfilter.c
index cf5a88e5d7..b3807757f5 100644
--- a/dfilter.c
+++ b/dfilter.c
@@ -1,7 +1,7 @@
/* dfilter.c
* Routines for display filters
- * $Id: dfilter.c,v 1.3 1999/07/08 03:35:30 gram Exp $
+ * $Id: dfilter.c,v 1.4 1999/07/11 08:40:51 guy Exp $
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -208,6 +208,9 @@ dfilter_compile(char *dfilter_text, GNode **p_dfcode)
dfilter_list_byte_arrays = NULL;
+ if (*p_dfcode != NULL)
+ g_node_destroy(*p_dfcode);
retval = yyparse();
*p_dfcode = dfilter_tree;
return retval;