acassis commented on issue #17213:
URL: https://github.com/apache/nuttx/issues/17213#issuecomment-3426423442
Nice finding @arikimari
I fixed it here this way:
`$ git diff fs/fat/fs_fat32dirent.c
diff --git a/fs/fat/fs_fat32dirent.c b/fs/fat/fs_fat32dirent.c
index b5baa6dca9..4abb020008 100644
--- a/fs/fat/fs_fat32dirent.c
+++ b/fs/fat/fs_fat32dirent.c
@@ -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;
`
Testing:
`NuttShell (NSH) NuttX-12.10.0
nsh> mkdir /tmp/test1
nsh> mkdir /tmp/test1/test2
nsh> ls /tmp/test1
/tmp/test1:
test2/
nsh> ls /tmp////test1
/tmp////test1:
test2/
nsh>`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]