updated on Mon Jan 16 00:01:41 UTC 2012
[aur-mirror.git] / tinyxml / entity.patch
blob66d89a61743d57c807ce239ebcd25fe9e0223d19
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 @@
11 unsigned char c = (unsigned char) str[i];
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 == '&' )
39 outString->append( entity[0].str, entity[0].strLength );
40 ++i;
41 Index: xmltest.cpp
42 ===================================================================
43 RCS file: /cvsroot/tinyxml/tinyxml/xmltest.cpp,v
44 retrieving revision 1.89
45 diff -u -r1.89 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 }*/
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
62 /* 1417717 experiment
64 TiXmlDocument xml;