]> git.saurik.com Git - wxWidgets.git/commitdiff
support for incorrect entries in .mime.types added (world is not perfect, alas)
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 23 Feb 1999 18:26:04 +0000 (18:26 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 23 Feb 1999 18:26:04 +0000 (18:26 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1759 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/mimetype.cpp

index e4dcc9cf34583143eb1f451694ffe38670a9c94e..b94fe97f1b623f010feac50e245d749a95753b8c 100644 (file)
@@ -993,6 +993,16 @@ void wxMimeTypesManagerImpl::ReadMimeTypes(const wxString& strFileName)
             }
         }
 
+        // although it doesn't seem to be covered by RFCs, some programs
+        // (notably Netscape) create their entries with several comma
+        // separated extensions (RFC mention the spaces only)
+        strExtensions.Replace(",", " ");
+
+        // also deal with the leading dot
+        if ( !strExtensions.IsEmpty() && strExtensions[0] == '.' ) {
+            strExtensions.erase(0, 1);
+        }
+
         int index = m_aTypes.Index(strMimeType);
         if ( index == wxNOT_FOUND ) {
             // add a new entry