sec_vt_header: dissect call_id
[metze/wireshark/wip.git] / capture.c
index 76882f086a5499dc60299c7d37621a7edb151c42..9477919d2aad85c6528fca43d2c8862e8cc2e1b0 100644 (file)
--- a/capture.c
+++ b/capture.c
@@ -31,6 +31,7 @@
 #endif
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include <glib.h>
@@ -646,6 +647,13 @@ capture_input_closed(capture_session *cap_session, gchar *msg)
 
     ws_unlink(capture_opts->save_file);
 
+    /* If we have a ring buffer, the original save file has been overwritten
+       with the "ring filename".  Restore it before starting again */
+    if ((capture_opts->multi_files_on) && (capture_opts->orig_save_file != NULL)) {
+      g_free(capture_opts->save_file);
+      capture_opts->save_file = g_strdup(capture_opts->orig_save_file);
+    }
+
     /* if it was a tempfile, throw away the old filename (so it will become a tempfile again) */
     if(cf_is_tempfile((capture_file *)cap_session->cf)) {
       g_free(capture_opts->save_file);