diff options
author | ulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-07-12 18:39:03 +0000 |
---|---|---|
committer | ulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-07-12 18:39:03 +0000 |
commit | 61f8d528ae387b69066bbb15d90a7de13a5c0845 (patch) | |
tree | a6f4a83836690d792200eee403368cf025235586 /gtk/dlg_utils.c | |
parent | 41f8334e5c7705feb4004b931acb772261967128 (diff) |
bugfix to a bug reported by Ian Schorr:
GTK2.4 open directory doesn't go into last opened dir
(this will affect all open file dialogs)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11365 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'gtk/dlg_utils.c')
-rw-r--r-- | gtk/dlg_utils.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/gtk/dlg_utils.c b/gtk/dlg_utils.c index 470b4f14b3..4c545f90df 100644 --- a/gtk/dlg_utils.c +++ b/gtk/dlg_utils.c @@ -1,7 +1,7 @@ /* dlg_utils.c * Utilities to use when constructing dialogs * - * $Id: dlg_utils.c,v 1.39 2004/06/20 19:35:04 ulfl Exp $ + * $Id: dlg_utils.c,v 1.40 2004/07/12 18:39:03 ulfl Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -425,8 +425,14 @@ file_selection_set_current_folder(GtkWidget *fs, const gchar *filename) int filename_len = strlen(filename); gchar *new_filename; - /* trim filename, so gtk_file_chooser_set_current_folder() likes it */ - if (filename[filename_len -1] == G_DIR_SEPARATOR && filename[1] != ':') { + /* trim filename, so gtk_file_chooser_set_current_folder() likes it, see below */ + if (filename[filename_len -1] == G_DIR_SEPARATOR +#ifdef WIN32 + && filename_len > 3) /* e.g. "D:\" */ +#else + && filename_len > 1) /* e.g. "/" */ +#endif + { new_filename = g_strdup(filename); new_filename[filename_len-1] = '\0'; } else { |