aboutsummaryrefslogtreecommitdiffstats
path: root/ui/gtk/capture_file_dlg.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2012-07-17 21:44:41 +0000
committerGuy Harris <guy@alum.mit.edu>2012-07-17 21:44:41 +0000
commit3074044f77c7ae8d4e564c7aeea76693770ee645 (patch)
treecf7a6c533c6426a734d9eedff8e38c449e2cc308 /ui/gtk/capture_file_dlg.c
parentc0a5bc9aa84b4ab80bada1110bec79e0b80500c1 (diff)
Set the folder to the containing directory of the file name in question,
not to the file itself (the file itself will be a plain file, so that will fail). svn path=/trunk/; revision=43776
Diffstat (limited to 'ui/gtk/capture_file_dlg.c')
-rw-r--r--ui/gtk/capture_file_dlg.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ui/gtk/capture_file_dlg.c b/ui/gtk/capture_file_dlg.c
index c3daf2f446..795ef395af 100644
--- a/ui/gtk/capture_file_dlg.c
+++ b/ui/gtk/capture_file_dlg.c
@@ -449,7 +449,10 @@ gtk_open_file(GtkWidget *w, GString *file_name, GString *display_filter)
gtk_widget_set_size_request(file_open_w, DEF_WIDTH, DEF_HEIGHT);
if (file_name->len > 0) {
- file_selection_set_current_folder(file_open_w, file_name->str);
+ gchar *dirname = g_path_get_dirname(file_name->str);
+
+ file_selection_set_current_folder(file_open_w, dirname);
+ g_free(dirname);
} else {
switch (prefs.gui_fileopen_style) {