aboutsummaryrefslogtreecommitdiff
path: root/lib/fstree/src
diff options
context:
space:
mode:
Diffstat (limited to 'lib/fstree/src')
-rw-r--r--lib/fstree/src/add_by_path.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/fstree/src/add_by_path.c b/lib/fstree/src/add_by_path.c
index 344b586..f204836 100644
--- a/lib/fstree/src/add_by_path.c
+++ b/lib/fstree/src/add_by_path.c
@@ -15,16 +15,23 @@
tree_node_t *fstree_add_generic(fstree_t *fs, const char *path,
const struct stat *sb, const char *extra)
{
+ return fstree_add_generic_at(fs, fs->root, path, sb, extra);
+}
+
+tree_node_t *fstree_add_generic_at(fstree_t *fs, tree_node_t *root,
+ const char *path, const struct stat *sb,
+ const char *extra)
+{
tree_node_t *child, *parent;
const char *name;
if (*path == '\0') {
- child = fs->root;
+ child = root;
assert(child != NULL);
goto out;
}
- parent = fstree_get_node_by_path(fs, fs->root, path, true, true);
+ parent = fstree_get_node_by_path(fs, root, path, true, true);
if (parent == NULL)
return NULL;