From 49feff26fb0867a4da5afedc19ecea979b5fa0ca Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 25 Jan 2000 01:05:06 +0000 Subject: [PATCH] "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 --- file.c | 10 ++++++---- 1 file 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 @@ -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) {