aboutsummaryrefslogtreecommitdiffstats
path: root/ui/gtk
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2012-09-19 23:06:39 +0000
committerGerald Combs <gerald@wireshark.org>2012-09-19 23:06:39 +0000
commit3e05236eff6c7f3638f7a1b94ca9a1f398e673a1 (patch)
tree317abd2f993a717080c6588a4923168c7b1413f8 /ui/gtk
parentb5d6160447cc53a5be566ba4c341d6c948098f13 (diff)
Add gzip support to the Win32 "Save As" dialog. Don't crash in the Win32
merge dialog if we cancel. Adjust the size and location of the controls in the Win32 open and merge file templates. svn path=/trunk/; revision=45014
Diffstat (limited to 'ui/gtk')
-rw-r--r--ui/gtk/capture_file_dlg.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/ui/gtk/capture_file_dlg.c b/ui/gtk/capture_file_dlg.c
index 4566061aca..2048eccb23 100644
--- a/ui/gtk/capture_file_dlg.c
+++ b/ui/gtk/capture_file_dlg.c
@@ -845,12 +845,14 @@ file_merge_cmd(GtkWidget *w _U_)
int file_type;
cf_status_t merge_status;
char *in_filenames[2];
- char *tmpname;
+ char *tmpname = NULL;
/*
* Loop until the user either selects a file or gives up.
*/
for (;;) {
+ g_string_truncate(file_name, 0);
+ g_string_truncate(display_filter, 0);
#ifdef USE_WIN32_FILE_DIALOGS
if (win32_merge_file(GDK_WINDOW_HWND(gtk_widget_get_window(top_level)), file_name, display_filter, &merge_type)) {
#else /* USE_WIN32_FILE_DIALOGS */
@@ -890,8 +892,6 @@ file_merge_cmd(GtkWidget *w _U_)
if (rfcode != NULL)
dfilter_free(rfcode);
g_free(tmpname);
- g_string_free(file_name, TRUE);
- g_string_free(display_filter, TRUE);
continue;
}
@@ -937,8 +937,10 @@ file_merge_cmd(GtkWidget *w _U_)
/* Save the name of the containing directory specified in the path name,
if any; we can write over cf_merged_name, which is a good thing, given that
"get_dirname()" does write over its argument. */
- set_last_open_dir(get_dirname(tmpname));
- g_free(tmpname);
+ if (tmpname) {
+ set_last_open_dir(get_dirname(tmpname));
+ g_free(tmpname);
+ }
g_string_free(file_name, TRUE);
g_string_free(display_filter, TRUE);
return;