提交 7ee46ceb 编写于 作者: B Benoît Thébaudeau 提交者: Tom Rini

FAT: Fix file contents listed as directory

With:
fatls mmc 0 /dir/file
dir: regular directory
file: regular file

The previous code read the contents of file as if it were directory entries to
list. This patch refuses to list file contents as if it were a folder.
Signed-off-by: NBenoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Wolfgang Denk <wd@denx.de>
上级 d5370feb
......@@ -1109,11 +1109,11 @@ rootdir_done:
goto exit;
}
if (idx >= 0) {
if (!(dentptr->attr & ATTR_DIR))
goto exit;
if (isdir && !(dentptr->attr & ATTR_DIR))
goto exit;
if (idx >= 0)
subname = nextname;
}
}
ret = get_contents(mydata, dentptr, buffer, maxsize);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册