From 4e40bd0f58047ceec9e5b162b16f54226bd45977 Mon Sep 17 00:00:00 2001 From: "sgunderson@bigfoot.com" <> Date: Thu, 22 Sep 2011 00:42:37 +0200 Subject: [PATCH] In C++0x, handle that attr->ns is NULL. Makes namespace test pass. --- c++0x/xml-template.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/c++0x/xml-template.cpp b/c++0x/xml-template.cpp index febece2..fda97fc 100644 --- a/c++0x/xml-template.cpp +++ b/c++0x/xml-template.cpp @@ -115,7 +115,8 @@ void Substitute::process(xmlNode *node, bool clean) string id; xmlAttr *id_attr = NULL; for (xmlAttr *attr = child->properties; attr != NULL; attr = attr->next) { - if (strcmp(reinterpret_cast(attr->ns->href), "http://template.sesse.net/") == 0 && + if (attr->ns != NULL && + strcmp(reinterpret_cast(attr->ns->href), "http://template.sesse.net/") == 0 && strcmp(reinterpret_cast(attr->name), "id") == 0) { xmlChar *id_buf = xmlNodeGetContent(attr->children); id = reinterpret_cast(id_buf); -- 2.39.2