From 67503cff975c04009dd3658c50cd9a4bf3a39ec5 Mon Sep 17 00:00:00 2001 From: "sgunderson@bigfoot.com" <> Date: Sat, 24 Sep 2011 00:12:57 +0200 Subject: [PATCH] In the C++11 version, we would set the wrong key on id+attribute matches. Fixed. --- c++11/xml-template.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/c++11/xml-template.cpp b/c++11/xml-template.cpp index 61d567f..503e5e3 100644 --- a/c++11/xml-template.cpp +++ b/c++11/xml-template.cpp @@ -201,7 +201,7 @@ void Substitute::process(xmlNode *node, bool clean) xmlSetProp(child, attr_key, attr_value); } else if ((!id.empty() && begins_with(it.first, "#" + id + "/"))) { const xmlChar *attr_key = reinterpret_cast( - it.first.c_str() + tag.size() + 2); + it.first.c_str() + id.size() + 2); const xmlChar *attr_value = reinterpret_cast( it.second->get_contents().c_str()); xmlSetProp(child, attr_key, attr_value); -- 2.39.2