entity.patch 1.7 KB

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