Ticket #6180: rapidxml.hpp.patch
File rapidxml.hpp.patch, 3.8 KB (added by , 11 years ago) |
---|
-
boost/property_tree/detail/rapidxml.hpp
1632 1632 1633 1633 // &#...; - assumes ASCII 1634 1634 case Ch('#'): 1635 if (src[2] == Ch('x'))1636 1635 { 1636 Ch* src_ascii = src; 1637 1637 unsigned long code = 0; 1638 src += 3; // Skip &#x 1639 while (1) 1638 if (src_ascii[2] == Ch('x')) 1640 1639 { 1641 unsigned char digit = internal::lookup_tables<0>::lookup_digits[static_cast<unsigned char>(*src)]; 1642 if (digit == 0xFF) 1643 break; 1644 code = code * 16 + digit; 1645 ++src; 1640 src_ascii += 3; // Skip &#x 1641 while (1) 1642 { 1643 unsigned char digit = internal::lookup_tables<0>::lookup_digits[static_cast<unsigned char>(*src_ascii)]; 1644 if (digit == 0xFF) 1645 break; 1646 code = code * 16 + digit; 1647 ++src_ascii; 1648 } 1646 1649 } 1647 insert_coded_character<Flags>(dest, code); // Put character in output 1648 } 1649 else 1650 { 1651 unsigned long code = 0; 1652 src += 2; // Skip &# 1653 while (1) 1650 else 1654 1651 { 1655 unsigned char digit = internal::lookup_tables<0>::lookup_digits[static_cast<unsigned char>(*src)]; 1656 if (digit == 0xFF) 1657 break; 1658 code = code * 10 + digit; 1659 ++src; 1652 src_ascii += 2; // Skip &# 1653 while (1) 1654 { 1655 unsigned char digit = internal::lookup_tables<0>::lookup_digits[static_cast<unsigned char>(*src_ascii)]; 1656 if (digit == 0xFF) 1657 break; 1658 code = code * 10 + digit; 1659 ++src_ascii; 1660 } 1660 1661 } 1661 insert_coded_character<Flags>(dest, code); // Put character in output 1662 if (*src_ascii == Ch(';')) 1663 { 1664 src = src_ascii + 1; 1665 insert_coded_character<Flags>(dest, code); // Put character in output 1666 continue; 1667 } 1668 break; 1662 1669 } 1663 if (*src == Ch(';'))1664 ++src;1665 else1666 BOOST_PROPERTY_TREE_RAPIDXML_PARSE_ERROR("expected ;", src);1667 continue;1668 1670 1669 1671 // Something else 1670 1672 default: