diff --git a/fs/fat/fs_fat32dirent.c b/fs/fat/fs_fat32dirent.c index ed58c9fa21e..b16f62719dc 100644 --- a/fs/fat/fs_fat32dirent.c +++ b/fs/fat/fs_fat32dirent.c @@ -607,6 +607,13 @@ static inline int fat_parselfname(FAR const char **path, dirinfo->fd_lfname[ndx] = '\0'; + /* Ignore sequences of //... in the filename */ + + while (node && *node == '/') + { + node++; + } + /* Return the remaining sub-string and the terminating character. */ *terminator = (char)ch;