]> cloudbase.mooo.com Git - z180-stamp.git/commitdiff
Apply patch ff13b_p1
authorLeo C <erbl259-lmu@yahoo.de>
Sun, 27 May 2018 20:06:51 +0000 (22:06 +0200)
committerLeo C <erbl259-lmu@yahoo.de>
Sun, 27 May 2018 20:06:51 +0000 (22:06 +0200)
fatfs/source/ff.c

index a114c6bb5a6402a4e1ab7cf63ef910b19dd29e7b..c57a3206653972c4ac3760bcb6eb43645460d481 100644 (file)
@@ -1728,7 +1728,8 @@ static FRESULT dir_next ( /* FR_OK(0):succeeded, FR_NO_FILE:End of table, FR_DEN
 \r
 \r
        ofs = dp->dptr + SZDIRE;        /* Next entry */\r
-       if (dp->sect == 0 || ofs >= (DWORD)((FF_FS_EXFAT && fs->fs_type == FS_EXFAT) ? MAX_DIR_EX : MAX_DIR)) return FR_NO_FILE;        /* Report EOT when offset has reached max value */\r
+       if (ofs >= (DWORD)((FF_FS_EXFAT && fs->fs_type == FS_EXFAT) ? MAX_DIR_EX : MAX_DIR)) dp->sect = 0;      /* Disable it if the offset reached the max value */\r
+       if (dp->sect == 0) return FR_NO_FILE;   /* Report EOT if it has been disabled */\r
 \r
        if (ofs % SS(fs) == 0) {        /* Sector changed? */\r
                dp->sect++;                             /* Next sector */\r