From 79973061600a2af480c4f8ec1e1e71846985b653 Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Wed, 17 Feb 2021 17:59:05 -0500 Subject: dirlist program, making fat refuse to list file as directory --- src/kernel/fat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/kernel/fat.c') 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; } -- cgit v1.2.3