summaryrefslogtreecommitdiff
path: root/src/kernel/fat.c
diff options
context:
space:
mode:
authorBenji Dial <benji6283@gmail.com>2021-02-17 17:59:05 -0500
committerBenji Dial <benji6283@gmail.com>2021-02-17 17:59:05 -0500
commit79973061600a2af480c4f8ec1e1e71846985b653 (patch)
treef63a54b5116bd19e2f82b14261c65584d80407f5 /src/kernel/fat.c
parent302666775a00b1df398ca06b97aa481a6626045d (diff)
downloadportland-os-79973061600a2af480c4f8ec1e1e71846985b653.tar.gz
dirlist program, making fat refuse to list file as directory
Diffstat (limited to 'src/kernel/fat.c')
-rw-r--r--src/kernel/fat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/kernel/fat.c b/src/kernel/fat.c
index befc1d8..5ba62cf 100644
--- a/src/kernel/fat.c
+++ b/src/kernel/fat.c
@@ -328,7 +328,7 @@ static uint32_t fat_enumerate_dir(const struct drive *d, const char *path, struc
if (!*path)
return enumerate_root(d, info, max);
- if (!try_load_from_path(d, path)) {
+ if (!try_load_from_path(d, path) || !(cur_dir->attrib & FA_DIRECTORY)) {
d->done(d);
return 0;
}
@@ -397,7 +397,7 @@ static uint32_t fat_n_dir_entries(const struct drive *d, const char *path) {
if (!*path)
return n_root_entries(d);
- if (!try_load_from_path(d, path)) {
+ if (!try_load_from_path(d, path) || !(cur_dir->attrib & FA_DIRECTORY)) {
d->done(d);
return 0;
}