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:
parent
70e42f5bfe
commit
006afeb21f
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user