Skip to content

Commit 26b3c6b

Browse files
committed
fixes from 256boss
1 parent b23fa7b commit 26b3c6b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/fsfat.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ static struct fs_node *open(struct filesys *fs, const char *path, unsigned int f
411411
fatdent = dent->data;
412412

413413
if((fatdent->first_cluster_low | fatdent->first_cluster_high) == 0) {
414-
if(fatdent->attr == ATTR_DIR) {
414+
if(fatdent->attr & ATTR_DIR) {
415415
/* ".." entries back to the root directory seem to have a 0
416416
* cluster address as a special case
417417
*/
@@ -420,7 +420,7 @@ static struct fs_node *open(struct filesys *fs, const char *path, unsigned int f
420420
return 0; /* but we can't have 0-address files (right?) */
421421
}
422422
} else {
423-
newdir = fatdent->attr == ATTR_DIR ? load_dir(fatfs, fatdent) : 0;
423+
newdir = (fatdent->attr & ATTR_DIR) ? load_dir(fatfs, fatdent) : 0;
424424
}
425425
if(dir != fatfs->rootdir && dir != cwdnode->data) {
426426
free_dir(dir);
@@ -659,7 +659,7 @@ static struct fat_dir *load_dir(struct fatfs *fs, struct fat_dirent *dent)
659659
char *buf = 0;
660660
int bufsz = 0;
661661

662-
if(dent->attr != ATTR_DIR) return 0;
662+
if(!(dent->attr & ATTR_DIR)) return 0;
663663

664664
addr = dent->first_cluster_low;
665665
if(fs->type >= FAT32) {
@@ -720,7 +720,7 @@ static void parse_dir_entries(struct fat_dir *dir)
720720
}
721721
strcpy(eptr->name, entname);
722722
eptr->data = dent;
723-
eptr->type = dent->attr == ATTR_DIR ? FSNODE_DIR : FSNODE_FILE;
723+
eptr->type = (dent->attr & ATTR_DIR) ? FSNODE_DIR : FSNODE_FILE;
724724
eptr->fsize = dent->size_bytes;
725725
eptr++;
726726
}
@@ -942,7 +942,7 @@ static void dbg_printdir(struct fat_dirent *dir, int max_entries)
942942
while(!DENT_IS_NULL(dir) && (!end || dir < end)) {
943943
if(!DENT_IS_UNUSED(dir) && dir->attr != ATTR_VOLID && dir->attr != ATTR_LFN) {
944944
if(dent_filename(dir, prev, name) > 0) {
945-
printf("%s%c\n", name, dir->attr == ATTR_DIR ? '/' : ' ');
945+
printf("%s%c\n", name, (dir->attr & ATTR_DIR) ? '/' : ' ');
946946
}
947947
}
948948
if(dir->attr != ATTR_LFN) {

src/intr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ void end_of_irq(int irq)
252252
disable_intr();
253253

254254
if(!eoi_pending) {
255+
set_intr_flags(intr_state);
255256
return;
256257
}
257258
eoi_pending = 0;

0 commit comments

Comments
 (0)