From aa8c8b29378f6bea955a66e4e520dc8f9da6110a Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Thu, 28 Jul 2016 23:13:07 -0700 Subject: [PATCH] FatFs: Apply patch ff12a_p3.diff. --- firmware/chibios-portapack/ext/fatfs/src/ff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firmware/chibios-portapack/ext/fatfs/src/ff.c b/firmware/chibios-portapack/ext/fatfs/src/ff.c index 7fe9668f..5bec9ccd 100644 --- a/firmware/chibios-portapack/ext/fatfs/src/ff.c +++ b/firmware/chibios-portapack/ext/fatfs/src/ff.c @@ -2266,7 +2266,7 @@ FRESULT dir_register ( /* FR_OK:succeeded, FR_DENIED:no free entry or too many S if (res != FR_OK) return res; dp->blk_ofs = dp->dptr - SZDIRE * (nent - 1); /* Set block position */ - if (dp->obj.stat & 4) { /* Has the sub-directory been stretched? */ + if (dp->obj.sclust != 0 && (dp->obj.stat & 4)) { /* Has the sub-directory been stretched? */ dp->obj.stat &= 3; dp->obj.objsize += (DWORD)fs->csize * SS(fs); /* Increase object size by cluster size */ res = fill_fat_chain(&dp->obj); /* Complement FAT chain if needed */