summaryrefslogtreecommitdiff
path: root/src/kernel/fat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/fat.c')
-rw-r--r--src/kernel/fat.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/kernel/fat.c b/src/kernel/fat.c
index c297cab..c4461de 100644
--- a/src/kernel/fat.c
+++ b/src/kernel/fat.c
@@ -119,10 +119,17 @@ static const uint8_t this_dir[] = {'.', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '
static const uint8_t parent_dir[] = {'.', '.', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '};
static inline bool check_fat_names(const uint8_t *a, const uint8_t *b) {
- return (((uint32_t *)a)[0] == ((uint32_t *)b)[0]) &&
- (((uint32_t *)a)[1] == ((uint32_t *)b)[1]) &&
- (((uint16_t *)a)[4] == ((uint16_t *)b)[4]) &&
- (((uint8_t *)a)[10] == ((uint8_t *)b)[10]);
+ for (uint8_t i = 0; i < 11; ++i) {
+ uint8_t ac = a[i];
+ uint8_t bc = b[i];
+ if ((ac >= 0x61) && (ac <= 0x7a))
+ ac &= ~0x20;
+ if ((bc >= 0x61) && (bc <= 0x7a))
+ bc &= ~0x20;
+ if (ac != bc)
+ return false;
+ }
+ return true;
}
//after: cur_dir -> specified entry in root