From 122fc27e3ecd8d91581323f583088a6a03e1360a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 16 Sep 2009 11:37:46 +0000 Subject: [PATCH] Check for self-assignment in wxFileName::operator=(). This is a backport of r56794 from trunk but adds the check for self-assignment to the Assign() implementation which is in a .cpp file and so is compiled into the library and not operator=() itself which is inlined to avoid any problems with mixing different version of this inline function when updating to next 2.8 version without recompiling. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@61943 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/filename.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/common/filename.cpp b/src/common/filename.cpp index b2303b1438..e95c16dfaf 100644 --- a/src/common/filename.cpp +++ b/src/common/filename.cpp @@ -305,6 +305,9 @@ static bool IsUNCPath(const wxString& path, wxPathFormat format) void wxFileName::Assign( const wxFileName &filepath ) { + if ( &filepath == this ) + return; + m_volume = filepath.GetVolume(); m_dirs = filepath.GetDirs(); m_name = filepath.GetName();