fs/procfs: Restore a necessary chagne that was lost with commit 07f441eecb

This commit is contained in:
Gregory Nutt 2017-10-28 17:13:52 -06:00
parent 9ccdb06ded
commit a50c5d6674

View File

@ -795,7 +795,13 @@ static int procfs_readdir(struct inode *mountpt, struct fs_dirent_s *dir)
strncpy(dir->fd_dir.d_name, name, level0->lastlen); strncpy(dir->fd_dir.d_name, name, level0->lastlen);
dir->fd_dir.d_name[level0->lastlen] = '\0'; dir->fd_dir.d_name[level0->lastlen] = '\0';
if (entry->type == PROCFS_DIR_TYPE) /* If the entry is a directory type OR if the reported name is
* only a sub-string of the entry (meaning that it contains
* '/'), then report this entry as a directory.
*/
if (entry->type == PROCFS_DIR_TYPE ||
level0->lastlen != strlen(name))
{ {
dir->fd_dir.d_type = DTYPE_DIRECTORY; dir->fd_dir.d_type = DTYPE_DIRECTORY;
} }