Merge branch 'R0.10c+patch1'

This commit is contained in:
Christopher Williams
2015-01-31 09:58:59 -07:00
+3 -1
View File
@@ -3486,8 +3486,9 @@ FRESULT f_unlink (
if (dir[DIR_Attr] & AM_RDO)
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);
if (dir[DIR_Attr] & AM_DIR) { /* Is it a sub-dir? */
if (!dclst) {
res = FR_INT_ERR;
} else { /* Make sure the sub-directory is empty */
@@ -3505,6 +3506,7 @@ FRESULT f_unlink (
}
}
}
}
if (res == FR_OK) {
res = dir_remove(&dj); /* Remove the directory entry */
if (res == FR_OK && dclst) /* Remove the cluster chain if exist */