- for (sibling=parent->child; sibling; sibling=sibling->sibling) {
- Dmsg2(100, "sibling->fname=%s fname=%s\n", sibling->fname, fname);
- if (strcmp(sibling->fname, fname) == 0) {
- Dmsg1(100, "make_tree_path: found parent=%s\n", parent->fname);
- if (q) { /* if trailing slash on entry */
- *q = '/'; /* restore it */
- }
- return sibling;
- }
- }
-
- append_tree_node(fname, node, root, parent);
- Dmsg1(100, "insert_tree_node: parent=%s\n", parent->fname);
- if (q) { /* if trailing slash on entry */
+ node = search_and_insert_tree_node(fname, 0, root, parent);
+ if (q) { /* if trailing slash on entry */