at master 1.7 kB view raw
1? entity.patch 2Index: a/tinyxml.cpp 3=================================================================== 4RCS file: b/tinyxml.cpp,v 5retrieving revision 1.105 6diff -u -r1.105 a/tinyxml.cpp 7--- tinyxml.cpp 5 Jun 2010 19:06:57 -0000 1.105 8+++ tinyxml.cpp 19 Jul 2010 21:24:16 -0000 9@@ -57,30 +57,7 @@ 10 { 11 unsigned char c = (unsigned char) str[i]; 12 13- if ( c == '&' 14- && i < ( (int)str.length() - 2 ) 15- && str[i+1] == '#' 16- && str[i+2] == 'x' ) 17- { 18- // Hexadecimal character reference. 19- // Pass through unchanged. 20- // &#xA9; -- copyright symbol, for example. 21- // 22- // The -1 is a bug fix from Rob Laveaux. It keeps 23- // an overflow from happening if there is no ';'. 24- // There are actually 2 ways to exit this loop - 25- // while fails (error case) and break (semicolon found). 26- // However, there is no mechanism (currently) for 27- // this function to return an error. 28- while ( i<(int)str.length()-1 ) 29- { 30- outString->append( str.c_str() + i, 1 ); 31- ++i; 32- if ( str[i] == ';' ) 33- break; 34- } 35- } 36- else if ( c == '&' ) 37+ if ( c == '&' ) 38 { 39 outString->append( entity[0].str, entity[0].strLength ); 40 ++i; 41Index: a/xmltest.cpp 42=================================================================== 43RCS file: b/xmltest.cpp,v 44retrieving revision 1.89 45diff -u -r1.89 a/xmltest.cpp 46--- xmltest.cpp 5 Jun 2010 17:41:52 -0000 1.89 47+++ xmltest.cpp 19 Jul 2010 21:24:16 -0000 48@@ -1340,6 +1340,16 @@ 49 }*/ 50 } 51 52+ #ifdef TIXML_USE_STL 53+ { 54+ TiXmlDocument xml; 55+ xml.Parse("<foo>foo&amp;#xa+bar</foo>"); 56+ std::string str; 57+ str << xml; 58+ XmlTest( "Entity escaping", "<foo>foo&amp;#xa+bar</foo>", str.c_str() ); 59+ } 60+ #endif 61+ 62 /* 1417717 experiment 63 { 64 TiXmlDocument xml;