summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/xmlfile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/util/xmlfile.cpp')
-rw-r--r--src/lib/util/xmlfile.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/util/xmlfile.cpp b/src/lib/util/xmlfile.cpp
index e1bd1941734..be7bab597ca 100644
--- a/src/lib/util/xmlfile.cpp
+++ b/src/lib/util/xmlfile.cpp
@@ -465,8 +465,14 @@ data_node *data_node::copy_into(data_node &parent) const
}
else
{
- dst = dst->get_parent();
- src = src->get_parent()->get_next_sibling();
+ do
+ {
+ dst = dst->get_parent();
+ src = src->get_parent();
+ next = src->get_next_sibling();
+ }
+ while (!next && (&parent != dst));
+ src = next;
}
}
}