You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/07/17 23:24:42 UTC

[GitHub] [incubator-nuttx] acassis commented on a change in pull request #4171: fs/tmpfs: Handle the tail '/' correctly

acassis commented on a change in pull request #4171:
URL: https://github.com/apache/incubator-nuttx/pull/4171#discussion_r671755255



##########
File path: fs/tmpfs/fs_tmpfs.c
##########
@@ -455,6 +455,13 @@ static int tmpfs_find_dirent(FAR struct tmpfs_directory_s *tdo,
 {
   int i;
 
+  if (len && name[len - 1] == '/')

Review comment:
       Why don't you do the same as you did for namelen:
   if (len == 0)
     {
       return -EINVAL;
     }
   else if (name[len - 1] == '/')

##########
File path: fs/tmpfs/fs_tmpfs.c
##########
@@ -992,14 +1026,21 @@ static int tmpfs_find_file(FAR struct tmpfs_s *fs,
                            FAR struct tmpfs_directory_s **parent)
 {
   FAR struct tmpfs_object_s *to;
+  size_t len;
   int ret;
 
+  len = strlen(relpath);
+  if (len && relpath[len - 1] == '/')

Review comment:
       Ditto




-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org