mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-01-08 19:17:39 +00:00
FatFs: Apply patch ff12a_p6.diff.
This commit is contained in:
parent
60cc9b7faa
commit
11a5aa9766
@ -4038,11 +4038,16 @@ FRESULT f_lseek (
|
|||||||
}
|
}
|
||||||
if (clst != 0) {
|
if (clst != 0) {
|
||||||
while (ofs > bcs) { /* Cluster following loop */
|
while (ofs > bcs) { /* Cluster following loop */
|
||||||
|
ofs -= bcs; fp->fptr += bcs;
|
||||||
#if !_FS_READONLY
|
#if !_FS_READONLY
|
||||||
if (fp->flag & FA_WRITE) { /* Check if in write mode or not */
|
if (fp->flag & FA_WRITE) { /* Check if in write mode or not */
|
||||||
|
if (_FS_EXFAT && fp->fptr > fp->obj.objsize) { /* No FAT chain object needs correct objsize to generate FAT value */
|
||||||
|
fp->obj.objsize = fp->fptr;
|
||||||
|
fp->flag |= FA_MODIFIED;
|
||||||
|
}
|
||||||
clst = create_chain(&fp->obj, clst); /* Force stretch if in write mode */
|
clst = create_chain(&fp->obj, clst); /* Force stretch if in write mode */
|
||||||
if (clst == 0) { /* When disk gets full, clip file size */
|
if (clst == 0) { /* When disk gets full, clip file size */
|
||||||
ofs = bcs; break;
|
ofs = 0; break;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
@ -4050,8 +4055,6 @@ FRESULT f_lseek (
|
|||||||
if (clst == 0xFFFFFFFF) ABORT(fs, FR_DISK_ERR);
|
if (clst == 0xFFFFFFFF) ABORT(fs, FR_DISK_ERR);
|
||||||
if (clst <= 1 || clst >= fs->n_fatent) ABORT(fs, FR_INT_ERR);
|
if (clst <= 1 || clst >= fs->n_fatent) ABORT(fs, FR_INT_ERR);
|
||||||
fp->clust = clst;
|
fp->clust = clst;
|
||||||
fp->fptr += bcs;
|
|
||||||
ofs -= bcs;
|
|
||||||
}
|
}
|
||||||
fp->fptr += ofs;
|
fp->fptr += ofs;
|
||||||
if (ofs % SS(fs)) {
|
if (ofs % SS(fs)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user