Skip to content
Snippets Groups Projects
Commit 7ee46ceb authored by Benoît Thébaudeau's avatar Benoît Thébaudeau Committed by Tom Rini
Browse files

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: default avatarBenoît Thébaudeau <benoit.thebaudeau@advansee.com>
Cc: Wolfgang Denk <wd@denx.de>
parent d5370feb
No related branches found
No related tags found
No related merge requests found
...@@ -1109,11 +1109,11 @@ rootdir_done: ...@@ -1109,11 +1109,11 @@ rootdir_done:
goto exit; goto exit;
} }
if (idx >= 0) { if (isdir && !(dentptr->attr & ATTR_DIR))
if (!(dentptr->attr & ATTR_DIR)) goto exit;
goto exit;
if (idx >= 0)
subname = nextname; subname = nextname;
}
} }
ret = get_contents(mydata, dentptr, buffer, maxsize); ret = get_contents(mydata, dentptr, buffer, maxsize);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment