Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Xiph.Org
Icecast-Server
Commits
7ffe12bc
Commit
7ffe12bc
authored
Jun 27, 2018
by
Philipp Schafft
🦁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: Also copy XML childs when doing a node copy
parent
e24e524c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
4 deletions
+19
-4
src/reportxml.c
src/reportxml.c
+19
-4
No files found.
src/reportxml.c
View file @
7ffe12bc
...
...
@@ -446,14 +446,19 @@ reportxml_node_t * reportxml_node_parse_xmlnode(xmlNodePtr xmlnode)
static
reportxml_node_t
*
__reportxml_node_copy_with_db
(
reportxml_node_t
*
node
,
reportxml_database_t
*
db
,
ssize_t
depth
)
{
reportxml_node_t
*
ret
;
ssize_t
count
;
ssize_t
child_count
;
ssize_t
xml_child_count
;
size_t
i
;
if
(
!
node
)
return
NULL
;
count
=
reportxml_node_count_child
(
node
);
if
(
count
<
0
)
child_count
=
reportxml_node_count_child
(
node
);
if
(
child_count
<
0
)
return
NULL
;
xml_child_count
=
reportxml_node_count_xml_child
(
node
);
if
(
xml_child_count
<
0
)
return
NULL
;
ret
=
reportxml_node_parse_xmlnode
(
node
->
xmlnode
);
...
...
@@ -467,7 +472,7 @@ static reportxml_node_t * __reportxml_node_copy_with_db(reportxml_node_t *n
}
}
for
(
i
=
0
;
i
<
(
size_t
)
count
;
i
++
)
{
for
(
i
=
0
;
i
<
(
size_t
)
child_
count
;
i
++
)
{
reportxml_node_t
*
child
=
reportxml_node_get_child
(
node
,
i
);
if
(
db
&&
depth
>
0
)
{
...
...
@@ -495,6 +500,16 @@ static reportxml_node_t * __reportxml_node_copy_with_db(reportxml_node_t *n
}
}
for
(
i
=
0
;
i
<
(
size_t
)
xml_child_count
;
i
++
)
{
xmlNodePtr
child
=
reportxml_node_get_xml_child
(
node
,
i
);
if
(
reportxml_node_add_xml_child
(
ret
,
child
)
!=
0
)
{
xmlFreeNode
(
child
);
refobject_unref
(
ret
);
return
NULL
;
}
xmlFreeNode
(
child
);
}
return
ret
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment