From bf6d45ebf663a0f31021893d2369a95d96198c8f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 26 Aug 2007 20:40:33 +0000 Subject: [PATCH] don't overwrite the existing local file if we failed to open it but it does exist git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48404 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/fileconf.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/common/fileconf.cpp b/src/common/fileconf.cpp index 635c18a6ac..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(); + } } } -- 2.45.2