From 58978490ade6ac5e55cd8b76f422bc88d01f982d Mon Sep 17 00:00:00 2001 From: Jukka Laitinen Date: Wed, 19 Nov 2025 14:01:56 +0200 Subject: [PATCH] fs/fat: Ignore multiple consecutive slashes in long file names This fixes the same issue as in 1f157561568, for long file names. Signed-off-by: Jukka Laitinen --- fs/fat/fs_fat32dirent.c | 7 +++++++ 1 file changed, 7 insertions(+) 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;