Skip to content

Commit 51e643d

Browse files
committed
composefs-from-json: skip empty dir components
solves a problem where a path like "sys/" would cause to add a node with an empty name. Signed-off-by: Giuseppe Scrivano <[email protected]>
1 parent 58f326a commit 51e643d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/composefs-from-json.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,9 @@ static struct lcfs_node_s *get_or_add_node(const char *typ,
566566
while ((it = strsep(&dpath, "/"))) {
567567
struct lcfs_node_s *c;
568568

569+
if (it[0] == '\0')
570+
continue;
571+
569572
c = lcfs_node_lookup_child(node, it);
570573
if (c) {
571574
node = c;

0 commit comments

Comments
 (0)