From 03d605cb8b35dc44036ed86b7906b2dd125b8cdc Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Wed, 13 Sep 2023 17:36:38 +0200 Subject: [PATCH] composefs-from-json: skip path component "." skip the path component when it is a single dot, since it refers to the current directory. Signed-off-by: Giuseppe Scrivano --- tools/composefs-from-json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/composefs-from-json.c b/tools/composefs-from-json.c index de7ba432..d3669bb2 100644 --- a/tools/composefs-from-json.c +++ b/tools/composefs-from-json.c @@ -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);