提交 b07c3e1b 编写于 作者: C chenjing

Description: [fix] LFN dir entry leak

Bug: #I3J1IC
Test:
上级 5d68eb52
......@@ -1969,6 +1969,25 @@ FRESULT dir_find ( /* FR_OK(0):succeeded, !=0:error */
}
/*-----------------------------------------------------------------------*/
/* Directory handling - Calculate the LFN entry of the directory */
/*-----------------------------------------------------------------------*/
DWORD dir_ofs (
DIR* dp
)
{
#if FF_USE_LFN
UINT len, nent;
DWORD entry;
for (nlen = 0; fs->lfnbuf[nlen]; nlen++) ; /* Get lfn length */
nent = (dp->fn[NSFLAG] & NS_LFN) ? (nlen + 12) / 13 + 1 : 1; /* Number of entries of the lfn */
entry = dp->dptr - (nent - 1) * SZDIRE;
return entry;
#else
return dp->dptr;
#endif
}
#if !FF_FS_READONLY
......
......@@ -475,6 +475,7 @@ FRESULT dir_read_massive(DIR *dp, int vol);
#endif
FRESULT dir_remove(DIR *dp);
FRESULT dir_next(DIR *dp, int stretch);
DWORD dir_ofs(DIR* dp);
FRESULT dir_register(DIR *dp);
DWORD create_chain (FFOBJID* obj, DWORD clst);
FRESULT remove_chain (FFOBJID* obj, DWORD clst, DWORD pclst);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册