Backport r29665 to template file so that the change is not overwritten when we regene...
[obnox/wireshark/wip.git] / file.c
diff --git a/file.c b/file.c
index ee8a9bf94971838046a9f20f3f5783bbaa974e7b..18275993f51ab24fde502f42f1227dd208c7126f 100644 (file)
--- a/file.c
+++ b/file.c
@@ -402,10 +402,8 @@ cf_reset_state(capture_file *cf)
     cf->plist_chunk = NULL;
   }
 #endif
-  if (cf->rfcode != NULL) {
-    dfilter_free(cf->rfcode);
-    cf->rfcode = NULL;
-  }
+  dfilter_free(cf->rfcode);
+  cf->rfcode = NULL;
   cf->plist_start = NULL;
   cf->plist_end = NULL;
   cf_unselect_packet(cf);   /* nothing to select */
@@ -850,6 +848,11 @@ cf_continue_tail(capture_file *cf, volatile int to_read, int *err)
 
 #ifdef NEW_PACKET_LIST
   new_packet_list_thaw();
+  /* With the new packet list the first packet
+   * isn't automatically selected.
+   */
+  if(!cf->current_frame)
+         new_packet_list_select_first_row();
 #else
   /* XXX - this causes "flickering" of the list */
   packet_list_thaw();
@@ -1681,9 +1684,8 @@ cf_filter_packets(capture_file *cf, gchar *dftext, gboolean force)
   }
 
   /* Cleanup and release all dfilter resources */
-  if (dfcode != NULL){
-    dfilter_free(dfcode);
-  }
+  dfilter_free(dfcode);
+
   return CF_OK;
 }
 
@@ -2027,9 +2029,7 @@ rescan_packets(capture_file *cf, const char *action, const char *action_item,
   }
 
   /* Cleanup and release all dfilter resources */
-  if (dfcode != NULL){
-    dfilter_free(dfcode);
-  }
+  dfilter_free(dfcode);
 }
 
 #else
@@ -2320,9 +2320,7 @@ rescan_packets(capture_file *cf, const char *action, const char *action_item,
   }
 
   /* Cleanup and release all dfilter resources */
-  if (dfcode != NULL){
-    dfilter_free(dfcode);
-  }
+  dfilter_free(dfcode);
 }
 #endif /* NEW_PACKET_LIST */
 
@@ -4058,6 +4056,7 @@ cf_select_packet(capture_file *cf, int row)
   /* We don't need the columns here. */
   cf->edt = epan_dissect_new(TRUE, TRUE);
 
+  tap_build_interesting(cf->edt);
   epan_dissect_run(cf->edt, &cf->pseudo_header, cf->pd, cf->current_frame,
           NULL);