diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-04-28 00:50:31 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-04-29 00:26:32 +0200 |
commit | ea8ed35e8665be75923bb483c377421d24ae2faf (patch) | |
tree | 8f0eff30da56d1bb5143dd72e32054cd2c405766 /lib | |
parent | 1b832b6dfb8d9da2b94f07ccc95c03614b378786 (diff) |
gensquashfs: use stacked tree iterator in fstree_from_dir
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/fstree/src/add_by_path.c | 11 |
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; |