From 25e119496e222298c1f2510fdc236029cd2b5165 Mon Sep 17 00:00:00 2001 From: mintsuki Date: Wed, 1 Sep 2021 23:34:31 +0200 Subject: [PATCH] fat: Ignore volume label entries in directories. Fixes #107 --- stage23/fs/fat32.s2.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stage23/fs/fat32.s2.c b/stage23/fs/fat32.s2.c index 9626a114..44ee258a 100644 --- a/stage23/fs/fat32.s2.c +++ b/stage23/fs/fat32.s2.c @@ -265,6 +265,11 @@ static int fat32_open_in(struct fat32_context* context, struct fat32_directory_e break; } + if (directory_entries[i].attribute & (1 << 3)) { + // It is a volume label, skip + continue; + } + if (directory_entries[i].attribute == FAT32_LFN_ATTRIBUTE) { struct fat32_lfn_entry* lfn = (struct fat32_lfn_entry*) &directory_entries[i];