diff --git a/Cantera/src/xml.cpp b/Cantera/src/xml.cpp index b9ebb1105..2316bcfb5 100755 --- a/Cantera/src/xml.cpp +++ b/Cantera/src/xml.cpp @@ -191,10 +191,12 @@ namespace Cantera { string attr, val; string s = strip(tag); iloc = s.find(' '); - if (iloc > 0) { + if (iloc != string::npos) { name = s.substr(0, iloc); s = strip(s.substr(iloc+1,s.size())); - if (s[s.size()-1] == '/') name += "/"; + if (s[s.size()-1] == '/') { + name += "/"; + } // get attributes while (1) { iloc = s.find('='); @@ -252,12 +254,6 @@ namespace Cantera { return tag; } else { -#ifdef DEBUG_HKM - //cout << "tag fed to parseTag = " << tag << endl; - //if (tag == "standardConc model=\"molar volume\" /") { - // cout << "we are here" << endl; - //} -#endif parseTag(tag, name, attribs); return name; } @@ -587,8 +583,22 @@ namespace Cantera { m_level = level; string indent(level, ' '); if (m_iscomment) { - s << endl << indent << ""; - return; + /* + * In the comment section, we test to see if there + * already is a space beginning and ending the comment. + * If there already is one, we don't add another one. + */ + s << endl << indent << ""; + return; } s << indent << "<" << m_name;