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

This commit is contained in:
mintsuki 2021-09-01 23:34:31 +02:00
parent 134fd3c8bd
commit 25e119496e

View File

@ -265,6 +265,11 @@ static int fat32_open_in(struct fat32_context* context, struct fat32_directory_e
break; break;
} }
if (directory_entries[i].attribute & (1 << 3)) {
// It is a volume label, skip
continue;
}
if (directory_entries[i].attribute == FAT32_LFN_ATTRIBUTE) { if (directory_entries[i].attribute == FAT32_LFN_ATTRIBUTE) {
struct fat32_lfn_entry* lfn = (struct fat32_lfn_entry*) &directory_entries[i]; struct fat32_lfn_entry* lfn = (struct fat32_lfn_entry*) &directory_entries[i];