fs/fat: Ignore //... sequences in the file path

This fixes an issue reported by user harishn6 on github.

Signed-off-by: Alan C. Assis <acassis@gmail.com>
This commit is contained in:
Alan C. Assis
2025-10-21 10:06:38 -03:00
committed by Matteo Golin
parent fb4274187b
commit 1f15756156

View File

@@ -362,6 +362,13 @@ static inline int fat_parsesfname(FAR const char **path,
#ifdef CONFIG_FAT_LCNAMES
dirinfo->fd_ntflags = ntlcfound & ntlcenable;
#endif
/* Ignore sequences of //... in the filename */
while (node && *node == '/')
{
node++;
}
*terminator = ch;
*path = node;
return OK;