It's better to do it in the caller. Debug users may well want the full
node name.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
static const char *nodename(xmlNode *node, char *buf, int len)
{
static const char *nodename(xmlNode *node, char *buf, int len)
{
- /* Don't print out the node name if it is "text" */
- if (!strcmp(node->name, "text")) {
- node = node->parent;
- if (!node || !node->name)
- return "root";
- }
+
+ if (!node || !node->name)
+ return "root";
+ /* Don't print out the node name if it is "text" */
+ if (!strcmp(node->name, "text"))
+ node = node->parent;
+
name = nodename(node, buffer, sizeof(buffer));
entry(name, len, content);
name = nodename(node, buffer, sizeof(buffer));
entry(name, len, content);