From fc070a1d32e7d2f8d50df2545b9b23932b4b98d2 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Tue, 11 Oct 2005 11:12:24 +0000 Subject: [PATCH] fix AppendAttr doesn't overwrite --- stepmania/src/XmlFile.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stepmania/src/XmlFile.cpp b/stepmania/src/XmlFile.cpp index 6166c2d083..9605ed19f2 100644 --- a/stepmania/src/XmlFile.cpp +++ b/stepmania/src/XmlFile.cpp @@ -631,7 +631,9 @@ bool XNode::RemoveAttr( const CString &sName ) void XNode::AppendAttr( const CString &sName, const CString &sValue ) { - m_attrs.insert( m_attrs.end(), make_pair(sName,sValue) ); + pair ret = m_attrs.insert( make_pair(sName,sValue) ); + if( !ret.second ) + ret.first->second = sValue; // already existed } void XNode::AppendAttr( const CString &sName, float value ){ AppendAttr(sName,ssprintf("%f",value)); }