|
@@ -77,6 +77,7 @@ const Tag& File::get() const { return _ret; }
|
77
|
77
|
|
78
|
78
|
// _____________________________________________________________________________
|
79
|
79
|
bool File::next() {
|
|
80
|
+ if (!_s.tagStack.size()) return false;
|
80
|
81
|
// avoid too much stack copying
|
81
|
82
|
if (_prevs.tagStack.size() != _s.tagStack.size() ||
|
82
|
83
|
_prevs.tagStack.top() != _s.tagStack.top()) {
|
|
@@ -311,11 +312,13 @@ bool File::next() {
|
311
|
312
|
_c = _buffer[_which] + off;
|
312
|
313
|
}
|
313
|
314
|
|
314
|
|
- if (_s.tagStack.top() != "[root]") {
|
315
|
|
- // TODO error
|
316
|
|
- throw XmlFileException("XML tree not complete");
|
317
|
|
- } else {
|
318
|
|
- _s.tagStack.pop();
|
|
315
|
+ if (_s.tagStack.size()) {
|
|
316
|
+ if (_s.tagStack.top() != "[root]") {
|
|
317
|
+ // TODO error
|
|
318
|
+ throw XmlFileException("XML tree not complete");
|
|
319
|
+ } else {
|
|
320
|
+ _s.tagStack.pop();
|
|
321
|
+ }
|
319
|
322
|
}
|
320
|
323
|
_s.s = NONE;
|
321
|
324
|
_ret.name = "[root]";
|