X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/77f859c38ebc1677b2ed1aa2d615e84fb131e9d4..a9249b2eb2a40d8c71f828669045c4ddaa8dc5ff:/src/common/textfile.cpp diff --git a/src/common/textfile.cpp b/src/common/textfile.cpp index 63f02f1a37..26053922cd 100644 --- a/src/common/textfile.cpp +++ b/src/common/textfile.cpp @@ -31,13 +31,14 @@ #if wxUSE_TEXTFILE #ifndef WX_PRECOMP - #include "wx/string.h" - #include "wx/intl.h" - #include "wx/file.h" - #include "wx/log.h" + #include "wx/string.h" + #include "wx/intl.h" + #include "wx/file.h" + #include "wx/log.h" #endif #include "wx/textfile.h" +#include "wx/filename.h" // ============================================================================ // wxTextFile class implementation @@ -172,7 +173,11 @@ bool wxTextFile::OnRead(wxMBConv& conv) bool wxTextFile::OnWrite(wxTextFileType typeNew, wxMBConv& conv) { - wxTempFile fileTmp(m_strBufferName); + wxFileName fn = m_strBufferName; + if ( !fn.IsAbsolute() ) + fn.Normalize(); + + wxTempFile fileTmp(fn.GetFullName()); if ( !fileTmp.IsOpened() ) { wxLogError(_("can't write buffer '%s' to disk."), m_strBufferName.c_str());