summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-10-21 20:37:25 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2009-10-21 20:37:25 +0000
commit27ec5a0b37cc756f01bc5b9f05bc92c6a7ec400e (patch)
tree7edb05df0d439fb199e796d75b3e2aabfcfa6972
parentaabb302d60b5fb5fb0bf1403a4f4d3a935f32a11 (diff)
XPath: Fixed empty string literals, don't add empty nodes/attributes in node sets (i.e. for self axis)
git-svn-id: http://pugixml.googlecode.com/svn/trunk@172 99668b35-9821-0410-8761-19e4c4f06640
-rw-r--r--src/pugixpath.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pugixpath.cpp b/src/pugixpath.cpp
index b6d089c..ac4de31 100644
--- a/src/pugixpath.cpp
+++ b/src/pugixpath.cpp
@@ -820,6 +820,7 @@ namespace pugi
void contents_clear()
{
+ if (m_cur_lexeme_contents) m_cur_lexeme_contents[0] = 0;
m_clc_size = 0;
}
@@ -1434,6 +1435,8 @@ namespace pugi
void step_push(xpath_node_set& ns, const xml_attribute& a, const xml_node& parent)
{
+ if (!a) return;
+
// There are no attribute nodes corresponding to attributes that declare namespaces
// That is, "xmlns:..." or "xmlns"
if (!strncmp(a.name(), "xmlns", 5) && (a.name()[5] == 0 || a.name()[5] == ':')) return;
@@ -1461,6 +1464,8 @@ namespace pugi
void step_push(xpath_node_set& ns, const xml_node& n)
{
+ if (!n) return;
+
switch (m_test)
{
case nodetest_name: