X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b4a980f4f57a4e7eea00c55cbb3d139f97d90c20..5a1e0e91a1ca5ec98b0eeb335cda757d1261ed08:/src/unix/mimetype.cpp diff --git a/src/unix/mimetype.cpp b/src/unix/mimetype.cpp index 20b96b5c21..4a39baa089 100644 --- a/src/unix/mimetype.cpp +++ b/src/unix/mimetype.cpp @@ -1367,14 +1367,15 @@ size_t wxFileTypeImpl::GetAllCommands(wxArrayString *verbs, bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions) { - wxString strExtensions = m_manager->GetExtension(m_index[0]); + const wxString strExtensions = m_manager->GetExtension(m_index[0]); extensions.Empty(); // one extension in the space or comma-delimited list wxString strExt; - for ( const wxChar *p = strExtensions; /* nothing */; p++ ) + wxString::const_iterator end = strExtensions.end(); + for ( wxString::const_iterator p = strExtensions.begin(); /* nothing */; ++p ) { - if ( *p == wxT(' ') || *p == wxT(',') || *p == wxT('\0') ) + if ( p == end || *p == wxT(' ') || *p == wxT(',') ) { if ( !strExt.empty() ) { @@ -1384,7 +1385,7 @@ bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions) //else: repeated spaces // (shouldn't happen, but it's not that important if it does happen) - if ( *p == wxT('\0') ) + if ( p == end ) break; } else if ( *p == wxT('.') ) @@ -2488,8 +2489,7 @@ wxMimeTypesManagerImpl::ProcessOtherMailcapField(MailcapLineData& data, } // is this something of the form foo=bar? - const wxChar *pEq = wxStrchr(curField, wxT('=')); - if ( pEq != NULL ) + if ( curField.find('=') != wxString::npos ) { // split "LHS = RHS" in 2 wxString lhs = curField.BeforeFirst(wxT('=')),