aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-01-25 01:05:06 +0000
committerGuy Harris <guy@alum.mit.edu>2000-01-25 01:05:06 +0000
commit49feff26fb0867a4da5afedc19ecea979b5fa0ca (patch)
tree3031b1ff4ac720ed3f5ec3aaf353159f1cd6c882 /file.c
parent4bd85b6d7e8c1eca0f6342b503886dfae1c978fc (diff)
"If there aren't any packets to select" means "if there aren't any
packets displayed", not just "if there aren't any packets" - there may be packets but no displayed packets if the display filter didn't find any packets. NULL out the pointers to the first and last displayed packet when closing a capture file. svn path=/trunk/; revision=1548
Diffstat (limited to 'file.c')
-rw-r--r--file.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/file.c b/file.c
index 4122bc0cad..e89fcbfa7f 100644
--- a/file.c
+++ b/file.c
@@ -1,7 +1,7 @@
/* file.c
* File I/O routines
*
- * $Id: file.c,v 1.157 2000/01/25 00:36:35 guy Exp $
+ * $Id: file.c,v 1.158 2000/01/25 01:05:06 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -209,6 +209,8 @@ close_cap_file(capture_file *cf, void *w)
cf->plist = NULL;
cf->plist_end = NULL;
unselect_packet(cf); /* nothing to select */
+ cf->first_displayed = NULL;
+ cf->last_displayed = NULL;
/* Clear the packet list. */
gtk_clist_freeze(GTK_CLIST(packet_list));
@@ -326,9 +328,9 @@ read_cap_file(capture_file *cf)
/* Enable menu items that make sense if you have some captured packets. */
set_menus_for_captured_packets(TRUE);
- /* If we have any packets to select, select the first packet by making
- the first row the selected row. */
- if (cf->plist != NULL)
+ /* If we have any displayed packets to select, select the first of those
+ packets by making the first row the selected row. */
+ if (cf->first_displayed != NULL)
gtk_signal_emit_by_name(GTK_OBJECT(packet_list), "select_row", 0);
if (!success) {