fs/inode: when searching for nextname skip "/" and "./"

fix the problem that stat fails to use the relative path
An error will be reported if used in the following way:
stat("//./bin", &st);

Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
yinshengkai 2023-04-24 11:55:36 +08:00 committed by Xiang Xiao
parent 70e42f5bfe
commit 006afeb21f

View File

@ -559,5 +559,16 @@ FAR const char *inode_nextname(FAR const char *name)
name++;
}
/* Skip single '.' path segment, but not '..' */
if (*name == '.' && *(name + 1) == '/')
{
/* If there is a '/' after '.',
* continue searching from the next character
*/
name = inode_nextname(name);
}
return name;
}