X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/784d9056f4f91e8c0eb4261456ab016214e22e17..931d6a47c32a5b4c283243cb553ce71ee2b535d5:/src/common/ffile.cpp diff --git a/src/common/ffile.cpp b/src/common/ffile.cpp index 932498efcd..0f479565d2 100644 --- a/src/common/ffile.cpp +++ b/src/common/ffile.cpp @@ -4,7 +4,6 @@ // Author: Vadim Zeitlin // Modified by: // Created: 14.07.99 -// RCS-ID: $Id$ // Copyright: (c) 1998 Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// @@ -48,7 +47,7 @@ wxFFile::wxFFile(const wxString& filename, const wxString& mode) { - Detach(); + m_fp = NULL; (void)Open(filename, mode); } @@ -57,16 +56,16 @@ bool wxFFile::Open(const wxString& filename, const wxString& mode) { wxASSERT_MSG( !m_fp, wxT("should close or detach the old file first") ); - m_fp = wxFopen(filename, mode); + FILE* const fp = wxFopen(filename, mode); - if ( !m_fp ) + if ( !fp ) { wxLogSysError(_("can't open file '%s'"), filename); return false; } - m_name = filename; + Attach(fp, filename); return true; } @@ -82,7 +81,7 @@ bool wxFFile::Close() return false; } - Detach(); + m_fp = NULL; } return true;