diff options
Diffstat (limited to 'xml/parser.cxx')
-rw-r--r-- | xml/parser.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/xml/parser.cxx b/xml/parser.cxx index 28a17ce..db1a9d0 100644 --- a/xml/parser.cxx +++ b/xml/parser.cxx @@ -96,6 +96,9 @@ namespace xml pqname_ = &qname_; pvalue_ = &value_; + line_ = 0; + column_ = 0; + attr_i_ = 0; start_ns_i_ = 0; end_ns_i_ = 0; @@ -672,6 +675,12 @@ namespace xml is.read (b, static_cast<streamsize> (cap)); } + // If the caller hasn't configured the stream to use exceptions, + // then use the parsing exception to report an error. + // + if (is.bad () || (is.fail () && !is.eof ())) + throw parsing (*this, "io failure"); + bool eof (is.eof ()); s = XML_ParseBuffer (p_, static_cast<int> (is.gcount ()), eof); |