diff --git a/CASA/gui/FileChooser.cs b/CASA/gui/FileChooser.cs index 9706c2c6..7b78d1bc 100644 --- a/CASA/gui/FileChooser.cs +++ b/CASA/gui/FileChooser.cs @@ -111,16 +111,19 @@ namespace Novell.CASA.GUI if (m_sFileSelected != null) { - // is there a filter? - if (m_currentFilter.Length > 0) + if (m_iAction != FileChooser.ACTION_CHOOSE_DIR) { - int dotPosition = m_currentFilter.LastIndexOf("."); - if (dotPosition > 0) + // is there a filter? + if (m_currentFilter.Length > 0) { - string sFileExt = m_currentFilter.Substring(dotPosition); - if (!m_sFileSelected.EndsWith(sFileExt)) + int dotPosition = m_currentFilter.LastIndexOf("."); + if (dotPosition > 0) { - return m_currentDirectory + m_sFileSelected + sFileExt; + string sFileExt = m_currentFilter.Substring(dotPosition); + if (!m_sFileSelected.EndsWith(sFileExt) && (!sFileExt.EndsWith("*"))) + { + return m_currentDirectory + m_sFileSelected + sFileExt; + } } } }