Skip to content

Commit

Permalink
composefs-from-json: skip path component "."
Browse files Browse the repository at this point in the history
skip the path component when it is a single dot, since it refers to
the current directory.

Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Sep 13, 2023
1 parent df1bd03 commit 03d605c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/composefs-from-json.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ static struct lcfs_node_s *get_or_add_node(const char *typ,
while ((it = strsep(&dpath, "/"))) {
struct lcfs_node_s *c;

if (it[0] == '\0')
if (it[0] == '\0' || strcmp(it, ".") == 0)
continue;

c = lcfs_node_lookup_child(node, it);
Expand Down

0 comments on commit 03d605c

Please sign in to comment.