From 0965b21e27876b8381c3534c2df86128460c03f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20W=C3=A4ckerlin?= Date: Tue, 7 Apr 2009 14:58:28 +0000 Subject: [PATCH] fixed empty attribute reading bug --- src/xml.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/xml.cxx b/src/xml.cxx index 29c5843..a6b0505 100644 --- a/src/xml.cxx +++ b/src/xml.cxx @@ -552,7 +552,7 @@ namespace xml { if (nameRead) { // read attribute std::string attrname(1, c), attrvalue; while (is && is.get(c) && c!='=' && c!='>' && !ws(c)) attrname+=c; - while (c!='=' && is && is.get(c) && ws(c)); // skip ws, search '=' + while (ws(c) && is && is.get(c)); // skip ws, search '=' if (c=='=') { // get the value while (is && is.get(c) && ws(c)); // skip ws if (c!='"') @@ -560,7 +560,9 @@ namespace xml { while (is && is.get(c) && c!='"') attrvalue+=c; if (c!='"') throw attribute_value_not_quoted(position, is, tag, c, attrname); - } else is.unget(); // read too far + } else { + is.unget(); + }// read too far if (tag.attributes.find(attrname)!=tag.attributes.end()) throw duplicate_attribute(position, is, tag, attrname); tag.attributes[attrname] = attrvalue;