aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-10-05 16:46:45 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-10-05 16:46:45 +0000
commitadc50f34b544c842c2387b67a6592fd1cb518906 (patch)
tree5babdc9d276f93b56c6f6674773df3b63fc0c4d2
parentd8f0a3541b7db652c2ab52ad58175f11898d30c4 (diff)
downloadpaludis-adc50f34b544c842c2387b67a6592fd1cb518906.tar.gz
paludis-adc50f34b544c842c2387b67a6592fd1cb518906.tar.xz
Don't barf on empty herd elements
-rw-r--r--paludis/qa/files.m42
-rw-r--r--paludis/qa/libxml_utils.hh6
-rw-r--r--paludis/qa/metadata_file.cc8
3 files changed, 11 insertions, 5 deletions
diff --git a/paludis/qa/files.m4 b/paludis/qa/files.m4
index 0e80675..d9a4c6d 100644
--- a/paludis/qa/files.m4
+++ b/paludis/qa/files.m4
@@ -36,7 +36,7 @@ add(`homepage_check', `hh', `cc')
add(`inherits_check', `hh', `cc')
add(`iuse_check', `hh', `cc')
add(`keywords_check', `hh', `cc')
-add(`libxml_utils', `hh')
+add(`libxml_utils', `hh', `cc')
add(`license_check', `hh', `cc')
add(`message', `hh', `cc', `sr', `test')
add(`metadata_check', `hh', `cc')
diff --git a/paludis/qa/libxml_utils.hh b/paludis/qa/libxml_utils.hh
index dbe2896..04d610f 100644
--- a/paludis/qa/libxml_utils.hh
+++ b/paludis/qa/libxml_utils.hh
@@ -20,6 +20,9 @@
#ifndef PALUDIS_GUARD_PALUDIS_QA_LIBXML_UTILS_HH
#define PALUDIS_GUARD_PALUDIS_QA_LIBXML_UTILS_HH 1
+#include <libxml/parser.h>
+#include <string>
+
namespace paludis
{
namespace qa
@@ -52,6 +55,9 @@ namespace paludis
return _ptr;
}
};
+
+ std::string
+ retarded_libxml_string_to_string(const xmlChar * s);
}
}
diff --git a/paludis/qa/metadata_file.cc b/paludis/qa/metadata_file.cc
index ec6737f..536a6d3 100644
--- a/paludis/qa/metadata_file.cc
+++ b/paludis/qa/metadata_file.cc
@@ -58,7 +58,7 @@ namespace paludis
{
if (n->type == XML_ELEMENT_NODE)
{
- std::string name(reinterpret_cast<const char *>(n->name));
+ std::string name(retarded_libxml_string_to_string(n->name));
if (name == "maintainer")
{
_email.clear();
@@ -67,13 +67,13 @@ namespace paludis
maintainers.insert(std::make_pair(_email, _name));
}
else if (name == "herd")
- herds.insert(normalise(reinterpret_cast<const char *>(xmlNodeListGetString(doc,
+ herds.insert(normalise(retarded_libxml_string_to_string(xmlNodeListGetString(doc,
n->xmlChildrenNode, 1))));
else if (name == "email")
- _email = normalise(reinterpret_cast<const char *>(xmlNodeListGetString(
+ _email = normalise(retarded_libxml_string_to_string(xmlNodeListGetString(
doc, n->xmlChildrenNode, 1)));
else if (name == "name")
- _name = normalise(reinterpret_cast<const char *>(xmlNodeListGetString(
+ _name = normalise(retarded_libxml_string_to_string(xmlNodeListGetString(
doc, n->xmlChildrenNode, 1)));
else
handle_node(doc, n->children);