:: commit 25e119496e222298c1f2510fdc236029cd2b5165

mintsuki <mintsuki@protonmail.com> — 2021-09-01 21:34

parents: 134fd3c8bd

fat: Ignore volume label entries in directories. Fixes #107

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];
 
tab: 248 wrap: offon