From 94cba986108a0e0f42295572ca42c356d59328d7 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 24 Jul 2014 12:40:01 +0200 Subject: Fix bug in C++/Parser Expat support --- libxsd/xsd/cxx/parser/expat/elements.hxx | 4 +++- libxsd/xsd/cxx/parser/expat/elements.txx | 11 +++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'libxsd/xsd') diff --git a/libxsd/xsd/cxx/parser/expat/elements.hxx b/libxsd/xsd/cxx/parser/expat/elements.hxx index 86e7a73..c03bf1a 100644 --- a/libxsd/xsd/cxx/parser/expat/elements.hxx +++ b/libxsd/xsd/cxx/parser/expat/elements.hxx @@ -51,7 +51,9 @@ namespace xsd } }; - typedef std::unique_ptr parser_auto_ptr; + typedef + std::unique_ptr + parser_auto_ptr; #else // Simple auto pointer for Expat's XML_Parser object. // diff --git a/libxsd/xsd/cxx/parser/expat/elements.txx b/libxsd/xsd/cxx/parser/expat/elements.txx index d3fc0d9..ef9adb7 100644 --- a/libxsd/xsd/cxx/parser/expat/elements.txx +++ b/libxsd/xsd/cxx/parser/expat/elements.txx @@ -283,9 +283,10 @@ namespace xsd throw std::bad_alloc (); if (system_id || public_id) - parse_begin (parser, system_id ? *system_id : *public_id, eh); + parse_begin ( + parser.get (), system_id ? *system_id : *public_id, eh); else - parse_begin (parser, eh); + parse_begin (parser.get (), eh); // Temporarily unset the exception failbit. Also clear the // fail bit when we reset the old state if it was caused @@ -310,8 +311,10 @@ namespace xsd break; } - if (XML_Parse ( - parser, buf, is.gcount (), is.eof ()) == XML_STATUS_ERROR) + if (XML_Parse (parser.get (), + buf, + is.gcount (), + is.eof ()) == XML_STATUS_ERROR) { r = false; break; -- cgit v1.1