aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2009-04-12 14:24:58 +0100
committerAvatar David Leverton <levertond@googlemail.com> 2009-04-12 14:24:58 +0100
commit64a1cd4861595220ba66fa1c6c9cc445fae93e1b (patch)
tree3ddd6df5a12b9647691425adee29e1ee9926dd3f
parent8613caea8ce0afc90eb11a335998c91e2c008056 (diff)
downloadpaludis-64a1cd4861595220ba66fa1c6c9cc445fae93e1b.tar.gz
paludis-64a1cd4861595220ba66fa1c6c9cc445fae93e1b.tar.xz
libxml2 sucks
-rw-r--r--paludis/repositories/e/xml_things.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/paludis/repositories/e/xml_things.cc b/paludis/repositories/e/xml_things.cc
index c991cf4..9ad1efc 100644
--- a/paludis/repositories/e/xml_things.cc
+++ b/paludis/repositories/e/xml_things.cc
@@ -398,18 +398,21 @@ paludis_xml_things_create_metadata_xml_from_xml_file(const FSEntry & filename)
std::tr1::shared_ptr<xmlXPathObject> longdesc_object;
longdesc_object = manage_libxml_ptr(xmlXPathEvalExpression(stupid_libxml_string(
"//pkgmetadata/longdescription[@lang=\"en\"]"), doc_context.get()), xmlXPathFreeObject);
- if (0 == longdesc_object->nodesetval->nodeNr)
+ if (0 == longdesc_object->nodesetval || 0 == longdesc_object->nodesetval->nodeNr)
longdesc_object = manage_libxml_ptr(xmlXPathEvalExpression(stupid_libxml_string(
"//pkgmetadata/longdescription[not(@lang)]"), doc_context.get()), xmlXPathFreeObject);
- for (int i = 0 ; i != longdesc_object->nodesetval->nodeNr ; ++i)
+ if (0 != longdesc_object->nodesetval)
{
- text_context->node = longdesc_object->nodesetval->nodeTab[i];
- std::tr1::shared_ptr<xmlXPathObject> text_object(manage_libxml_ptr(
- xmlXPathEvalExpression(stupid_libxml_string("descendant::text()"),
- text_context.get()), xmlXPathFreeObject));
+ for (int i = 0 ; i != longdesc_object->nodesetval->nodeNr ; ++i)
+ {
+ text_context->node = longdesc_object->nodesetval->nodeTab[i];
+ std::tr1::shared_ptr<xmlXPathObject> text_object(manage_libxml_ptr(
+ xmlXPathEvalExpression(stupid_libxml_string("descendant::text()"),
+ text_context.get()), xmlXPathFreeObject));
- result->long_description() = extract_children_text(text_object);
+ result->long_description() = extract_children_text(text_object);
+ }
}
return result;