summaryrefslogtreecommitdiff
path: root/src/html/html_directory_element.c
diff options
context:
space:
mode:
authorMichael Drake <michael.drake@codethink.co.uk>2016-02-05 16:12:17 +0000
committerMichael Drake <michael.drake@codethink.co.uk>2016-02-05 16:12:17 +0000
commit43930a90a6961dfb264fa74edeefb762b183cbdf (patch)
treebe294c5e5aff9aafbbe2ea8c1d462b89f9e39412 /src/html/html_directory_element.c
parentbcc4b3e3c69c02107f45e0be2342750ce9119a53 (diff)
downloadlibdom-43930a90a6961dfb264fa74edeefb762b183cbdf.tar.gz
libdom-43930a90a6961dfb264fa74edeefb762b183cbdf.tar.bz2
Fix: Proper copy constructor for HTMLDirectoryElement.
Diffstat (limited to 'src/html/html_directory_element.c')
-rw-r--r--src/html/html_directory_element.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/src/html/html_directory_element.c b/src/html/html_directory_element.c
index e50a353..585af1c 100644
--- a/src/html/html_directory_element.c
+++ b/src/html/html_directory_element.c
@@ -137,9 +137,38 @@ void _dom_virtual_html_directory_element_destroy(dom_node_internal *node)
}
/* The virtual copy function, see src/core/node.c for detail */
-dom_exception _dom_html_directory_element_copy(dom_node_internal *old,
- dom_node_internal **copy)
+dom_exception _dom_html_directory_element_copy(
+ dom_node_internal *old, dom_node_internal **copy)
{
- return _dom_html_element_copy(old, copy);
+ dom_html_directory_element *new_node;
+ dom_exception err;
+
+ new_node = malloc(sizeof(dom_html_directory_element));
+ if (new_node == NULL)
+ return DOM_NO_MEM_ERR;
+
+ err = dom_html_directory_element_copy_internal(old, new_node);
+ if (err != DOM_NO_ERR) {
+ free(new_node);
+ return err;
+ }
+
+ *copy = (dom_node_internal *) new_node;
+
+ return DOM_NO_ERR;
+}
+
+dom_exception _dom_html_directory_element_copy_internal(
+ dom_html_directory_element *old,
+ dom_html_directory_element *new)
+{
+ dom_exception err;
+
+ err = dom_html_element_copy_internal(old, new);
+ if (err != DOM_NO_ERR) {
+ return err;
+ }
+
+ return DOM_NO_ERR;
}