diff --git a/fs/tmpfs/fs_tmpfs.c b/fs/tmpfs/fs_tmpfs.c index 58c39175e0..e4f5f25b32 100644 --- a/fs/tmpfs/fs_tmpfs.c +++ b/fs/tmpfs/fs_tmpfs.c @@ -889,6 +889,14 @@ static int tmpfs_find_object(FAR struct tmpfs_s *fs, * relpath. */ + /* Skip any slash. */ + + while (*segment == '/') + { + segment++; + len--; + } + next_segment = memchr(segment, '/', len); if (next_segment) {