diff --git a/src/gtk/filedlg.cpp b/src/gtk/filedlg.cpp index aa05bdac13..4589f3de1a 100644 --- a/src/gtk/filedlg.cpp +++ b/src/gtk/filedlg.cpp @@ -65,7 +65,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message, GtkFileSelection *sel = GTK_FILE_SELECTION(m_widget); m_path.Append(m_dir); - if(m_path.Last()!='/') m_path.Append('/'); + if(! m_path.IsEmpty() && m_path.Last()!='/') m_path.Append('/'); m_path.Append(m_fileName); if(m_path.Length()>1) gtk_file_selection_set_filename(sel,m_path); diff --git a/src/gtk1/filedlg.cpp b/src/gtk1/filedlg.cpp index aa05bdac13..4589f3de1a 100644 --- a/src/gtk1/filedlg.cpp +++ b/src/gtk1/filedlg.cpp @@ -65,7 +65,7 @@ wxFileDialog::wxFileDialog(wxWindow *parent, const wxString& message, GtkFileSelection *sel = GTK_FILE_SELECTION(m_widget); m_path.Append(m_dir); - if(m_path.Last()!='/') m_path.Append('/'); + if(! m_path.IsEmpty() && m_path.Last()!='/') m_path.Append('/'); m_path.Append(m_fileName); if(m_path.Length()>1) gtk_file_selection_set_filename(sel,m_path);