You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ag...@apache.org on 2020/08/03 20:00:32 UTC

[incubator-nuttx] 02/03: fs/romfs: Support the path with tail '/' correctly

This is an automated email from the ASF dual-hosted git repository.

aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 1bad139f88d18b8e26d2b77abe5c8735f866799f
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Fri Jul 31 02:51:05 2020 +0800

    fs/romfs: Support the path with tail '/' correctly
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
    Change-Id: I7ea668e50e68cb384d013349a2c8cfc2844f3b73
---
 fs/romfs/fs_romfsutil.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/fs/romfs/fs_romfsutil.c b/fs/romfs/fs_romfsutil.c
index bb6123d..92b24b7 100644
--- a/fs/romfs/fs_romfsutil.c
+++ b/fs/romfs/fs_romfsutil.c
@@ -751,6 +751,11 @@ int romfs_finddirentry(struct romfs_mountpt_s *rm,
           entrylen = terminator - entryname;
         }
 
+      if (entrylen == 0)
+        {
+          return OK;
+        }
+
       /* Long path segment names will be truncated to NAME_MAX */
 
       if (entrylen > NAME_MAX)