aboutsummaryrefslogtreecommitdiffstats
path: root/ui/gtk
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-12-03 17:57:34 -0800
committerGuy Harris <guy@alum.mit.edu>2016-12-04 03:12:23 +0000
commitdd98856afce144eb19104a6f40c1abedc9069558 (patch)
tree2136bbdee3544f4324bf214a78aff65da350682c /ui/gtk
parent5aede1bc50b6bb9ae13926e2249d22d95c12814e (diff)
Have separate merge APIs for regular file/temporary file/standard output.
This is similar to what we have for opening a dump file - one API that uses the file name as specified, one that creates a temporary file and provides the file name, and one that uses the standard output. All of those APIs handle closing the output file. Change-Id: I56beea7be347402773460b9148ab31a8f8bc51e1 Reviewed-on: https://code.wireshark.org/review/19059 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'ui/gtk')
-rw-r--r--ui/gtk/capture_file_dlg.c7
-rw-r--r--ui/gtk/drag_and_drop.c5
2 files changed, 5 insertions, 7 deletions
diff --git a/ui/gtk/capture_file_dlg.c b/ui/gtk/capture_file_dlg.c
index 2c7e0cab52..56267d761e 100644
--- a/ui/gtk/capture_file_dlg.c
+++ b/ui/gtk/capture_file_dlg.c
@@ -912,22 +912,21 @@ file_merge_cmd(GtkWidget *w _U_)
file_type = cfile.cd_t;
/* Try to merge or append the two files */
- tmpname = NULL;
if (merge_type == 0) {
/* chronological order */
in_filenames[0] = cfile.filename;
in_filenames[1] = file_name->str;
- merge_status = cf_merge_files(&tmpname, 2, in_filenames, file_type, FALSE);
+ merge_status = cf_merge_files_to_tempfile(&tmpname, 2, in_filenames, file_type, FALSE);
} else if (merge_type < 0) {
/* prepend file */
in_filenames[0] = file_name->str;
in_filenames[1] = cfile.filename;
- merge_status = cf_merge_files(&tmpname, 2, in_filenames, file_type, TRUE);
+ merge_status = cf_merge_files_to_tempfile(&tmpname, 2, in_filenames, file_type, TRUE);
} else {
/* append file */
in_filenames[0] = cfile.filename;
in_filenames[1] = file_name->str;
- merge_status = cf_merge_files(&tmpname, 2, in_filenames, file_type, TRUE);
+ merge_status = cf_merge_files_to_tempfile(&tmpname, 2, in_filenames, file_type, TRUE);
}
if (merge_status != CF_OK) {
diff --git a/ui/gtk/drag_and_drop.c b/ui/gtk/drag_and_drop.c
index 8f0d390c3e..4c34d29258 100644
--- a/ui/gtk/drag_and_drop.c
+++ b/ui/gtk/drag_and_drop.c
@@ -208,9 +208,8 @@ dnd_open_file_cmd(gchar *cf_names_freeme)
}
} else {
/* merge the files in chronological order */
- tmpname = NULL;
- if (cf_merge_files(&tmpname, in_file_count, in_filenames,
- WTAP_FILE_TYPE_SUBTYPE_PCAPNG, FALSE) == CF_OK) {
+ if (cf_merge_files_to_tempfile(&tmpname, in_file_count, in_filenames,
+ WTAP_FILE_TYPE_SUBTYPE_PCAPNG, FALSE) == CF_OK) {
/* Merge succeeded; close the currently-open file and try
to open the merged capture file. */
cf_close(&cfile);