R0.10c with patch 1
November 13, 2014 f_unlink function does not remove cluster chain of the file. It reads to a lost cluster of the FAT volume. This is added at a bugfix of R0.10c.
This commit is contained in:
@@ -3486,8 +3486,9 @@ FRESULT f_unlink (
|
|||||||
if (dir[DIR_Attr] & AM_RDO)
|
if (dir[DIR_Attr] & AM_RDO)
|
||||||
res = FR_DENIED; /* Cannot remove R/O object */
|
res = FR_DENIED; /* Cannot remove R/O object */
|
||||||
}
|
}
|
||||||
if (res == FR_OK && (dir[DIR_Attr] & AM_DIR)) { /* Is it a sub-dir? */
|
if (res == FR_OK) {
|
||||||
dclst = ld_clust(dj.fs, dir);
|
dclst = ld_clust(dj.fs, dir);
|
||||||
|
if (dir[DIR_Attr] & AM_DIR) { /* Is it a sub-dir? */
|
||||||
if (!dclst) {
|
if (!dclst) {
|
||||||
res = FR_INT_ERR;
|
res = FR_INT_ERR;
|
||||||
} else { /* Make sure the sub-directory is empty */
|
} else { /* Make sure the sub-directory is empty */
|
||||||
@@ -3505,6 +3506,7 @@ FRESULT f_unlink (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (res == FR_OK) {
|
if (res == FR_OK) {
|
||||||
res = dir_remove(&dj); /* Remove the directory entry */
|
res = dir_remove(&dj); /* Remove the directory entry */
|
||||||
if (res == FR_OK && dclst) /* Remove the cluster chain if exist */
|
if (res == FR_OK && dclst) /* Remove the cluster chain if exist */
|
||||||
|
|||||||
Reference in New Issue
Block a user