X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/89216929eeffa3d2f0cb84bd562442edb3264a00..4b5ac600de03bec2a73610f7fa566aa2cf2ce9f8:/src/common/fileconf.cpp?ds=inline diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index 6b1f5f5df2..07da5e6ff2 100644 --- a/src/common/fileconf.cpp +++ b/src/common/fileconf.cpp @@ -372,7 +372,16 @@ void wxFileConfig::Init() } else { - wxLogWarning(_("can't open user configuration file '%s'."), m_fnLocalFile.GetFullPath().c_str() ); + const wxString path = m_fnLocalFile.GetFullPath(); + wxLogWarning(_("can't open user configuration file '%s'."), + path.c_str()); + + if ( m_fnLocalFile.FileExists() ) + { + wxLogWarning(_("Changes won't be saved to avoid overwriting the existing file \"%s\""), + path.c_str()); + m_fnLocalFile.Clear(); + } } } @@ -458,7 +467,7 @@ wxFileConfig::wxFileConfig(wxInputStream &inStream, const wxMBConv& conv) #if wxUSE_UNICODE size_t len; - cbuf = conv.cMB2WC((char *)buf.GetData(), buf.GetDataLen(), &len); + cbuf = conv.cMB2WC((char *)buf.GetData(), buf.GetDataLen() + 1, &len); if ( !len && buf.GetDataLen() ) { wxLogError(_("Failed to read config options."));