X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2825b3f502d4ae3be76027d033aa18d57cd28bb1..6d7dec7bfc9748f4ae0dc052c1af04757b6f86b9:/src/common/fileconf.cpp diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index 1c0337284e..e3af92c28a 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -494,21 +494,21 @@ wxFileConfig::wxFileConfig(wxInputStream &inStream, wxMBConv& conv) wxString strTmp; char buf[1024]; - for ( ;; ) + do { inStream.Read(buf, WXSIZEOF(buf)); - if ( !inStream.IsOk() ) + const wxStreamError err = inStream.GetLastError(); + + if ( err != wxSTREAM_NO_ERROR && err != wxSTREAM_EOF ) { wxLogError(_("Error reading config options.")); break; } strTmp.append(wxConvertMB2WX(buf), inStream.LastRead()); - - if ( inStream.Eof() ) - break; } + while ( !inStream.Eof() ); strTrans = wxTextBuffer::Translate(strTmp); } @@ -663,7 +663,7 @@ void wxFileConfig::Parse(wxTextBuffer& buffer, bool bLocal) } else { // a key const wxChar *pEnd = pStart; - while ( *pEnd && *pEnd != wxT('=') && !wxIsspace(*pEnd) ) { + while ( *pEnd && *pEnd != wxT('=') /* && !wxIsspace(*pEnd)*/ ) { if ( *pEnd == wxT('\\') ) { // next character may be space or not - still take it because it's // quoted (unless there is nothing) @@ -677,7 +677,7 @@ void wxFileConfig::Parse(wxTextBuffer& buffer, bool bLocal) pEnd++; } - wxString strKey(FilterInEntryName(wxString(pStart, pEnd))); + wxString strKey(FilterInEntryName(wxString(pStart, pEnd).Trim())); // skip whitespace while ( wxIsspace(*pEnd) )