Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.3:Staging:A
pacemaker
pacemaker-xml-find-first-child.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File pacemaker-xml-find-first-child.patch of Package pacemaker
commit 16c59a49aa7365412b9f7977021dc6ec7207125a Author: Andrew Beekhof <andrew@beekhof.net> Date: Thu Feb 23 14:41:02 2017 +1100 xml: Correctly find the first child element diff --git a/include/crm/common/xml.h b/include/crm/common/xml.h index a9489150e..9d9118a87 100644 --- a/include/crm/common/xml.h +++ b/include/crm/common/xml.h @@ -316,15 +316,33 @@ __xml_next(xmlNode * child) } static inline xmlNode * +__xml_first_child_element(xmlNode * parent) +{ + xmlNode *child = NULL; + + if (parent) { + child = parent->children; + } + + while (child) { + if(child->type == XML_ELEMENT_NODE) { + return child; + } + child = child->next; + } + return NULL; +} + +static inline xmlNode * __xml_next_element(xmlNode * child) { - if (child) { + while (child) { child = child->next; - while (child && child->type != XML_ELEMENT_NODE) { - child = child->next; + if(child && child->type == XML_ELEMENT_NODE) { + return child; } } - return child; + return NULL; } void free_xml(xmlNode * child);
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor