X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0bf751e7e901fffb9ba9d850948915e33456524a..69659fd770f615210efac4b4fa741b3ad6223616:/src/common/mimecmn.cpp diff --git a/src/common/mimecmn.cpp b/src/common/mimecmn.cpp index 21eb8f5c0f..bbd1d1e86d 100644 --- a/src/common/mimecmn.cpp +++ b/src/common/mimecmn.cpp @@ -636,7 +636,18 @@ wxFileType * wxMimeTypesManager::GetFileTypeFromExtension(const wxString& ext) { EnsureImpl(); - wxFileType *ft = m_impl->GetFileTypeFromExtension(ext); + + wxString::const_iterator i = ext.begin(); + const wxString::const_iterator end = ext.end(); + wxString extWithoutDot; + if ( i != end && *i == '.' ) + extWithoutDot.assign(++i, ext.end()); + else + extWithoutDot = ext; + + wxCHECK_MSG( !ext.empty(), NULL, _T("extension can't be empty") ); + + wxFileType *ft = m_impl->GetFileTypeFromExtension(extWithoutDot); if ( !ft ) { // check the fallbacks