X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e3cff1fbb770cdfd531d641b8d7375df7a71f9b9..44f5b995740b69ba222e92a5f7da87080afe4367:/src/unix/mimetype.cpp diff --git a/src/unix/mimetype.cpp b/src/unix/mimetype.cpp index 36789f0add..5f6157c61e 100644 --- a/src/unix/mimetype.cpp +++ b/src/unix/mimetype.cpp @@ -6,7 +6,7 @@ // Created: 23.09.98 // RCS-ID: $Id$ // Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows license (part of wxExtra library) +// Licence: wxWindows licence (part of wxExtra library) ///////////////////////////////////////////////////////////////////////////// // known bugs; there may be others!! chris elliott, biol75@york.ac.uk 27 Mar 01 @@ -1879,6 +1879,10 @@ int wxMimeTypesManagerImpl::AddToMimeData(const wxString& strType, entryOld->AddOrReplaceVerb(verb, entry->GetCmd(i)); } } + + // as we don't store it anywhere, it won't be deleted later as + // usual -- do it immediately instead + delete entry; } } } @@ -2185,15 +2189,19 @@ bool wxMimeTypesManagerImpl::ReadMimeTypes(const wxString& strFileName) else if ( strLHS == wxT("exts") ) { strExtensions = strRHS; } - else { + else if ( strLHS != _T("icon") ) + { // this one is simply ignored: it usually refers to Netscape // built in icons which are useless for us anyhow - if ( strLHS != _T("icon") ) - { - // This crashes for some reason in wcslen() in libc. RR. - // wxLogWarning(_("Unknown field in file %s, line %d: '%s'."), - // strFileName.c_str(), nLine + 1, strLHS.c_str()); - } + } + else if ( !strLHS.StartsWith(_T("x-")) ) + { + // we suppose that all fields starting with "X-" are + // unregistered extensions according to the standard practice, + // but it may be worth telling the user about other junk in + // his mime.types file + wxLogWarning(_("Unknown field in file %s, line %d: '%s'."), + strFileName.c_str(), nLine + 1, strLHS.c_str()); } if ( !entryEnded ) {