Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62195 - trunk/boost/property_tree/detail
From: sebastian.redl_at_[hidden]
Date: 2010-05-25 07:54:28


Author: cornedbee
Date: 2010-05-25 07:54:27 EDT (Tue, 25 May 2010)
New Revision: 62195
URL: http://svn.boost.org/trac/boost/changeset/62195

Log:
Make encode_char_entities safe against empty strings, because Graph uses it that way. Fixes bug 4245. Based on patch by Christopher Alfeld.
Text files modified:
   trunk/boost/property_tree/detail/xml_parser_utils.hpp | 3 +++
   1 files changed, 3 insertions(+), 0 deletions(-)

Modified: trunk/boost/property_tree/detail/xml_parser_utils.hpp
==============================================================================
--- trunk/boost/property_tree/detail/xml_parser_utils.hpp (original)
+++ trunk/boost/property_tree/detail/xml_parser_utils.hpp 2010-05-25 07:54:27 EDT (Tue, 25 May 2010)
@@ -44,6 +44,9 @@
     template<class Ch>
     std::basic_string<Ch> encode_char_entities(const std::basic_string<Ch> &s)
     {
+ // Don't do anything for empty strings.
+ if(s.empty()) return s;
+
         typedef typename std::basic_string<Ch> Str;
         Str r;
         // To properly round-trip spaces and not uglify the XML beyond


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk