mirror of
https://github.com/CTCaer/hekate.git
synced 2025-08-09 09:38:44 +00:00
add some comments
This commit is contained in:
parent
63eaae0e1e
commit
21f21da85d
1 changed files with 7 additions and 1 deletions
|
@ -1914,8 +1914,10 @@ int fix_attributes(char *path, u32 *total, u32 is_root, u32 check_first_run)
|
||||||
u32 fileLength = 0;
|
u32 fileLength = 0;
|
||||||
static FILINFO fno;
|
static FILINFO fno;
|
||||||
|
|
||||||
|
// Should we set the bit of the entry directory?
|
||||||
if (check_first_run)
|
if (check_first_run)
|
||||||
{
|
{
|
||||||
|
// Read file attributes.
|
||||||
res = f_stat(path, &fno);
|
res = f_stat(path, &fno);
|
||||||
if (res != FR_OK)
|
if (res != FR_OK)
|
||||||
return res;
|
return res;
|
||||||
|
@ -1937,17 +1939,19 @@ int fix_attributes(char *path, u32 *total, u32 is_root, u32 check_first_run)
|
||||||
{
|
{
|
||||||
// Read a directory item.
|
// Read a directory item.
|
||||||
res = f_readdir(&dir, &fno);
|
res = f_readdir(&dir, &fno);
|
||||||
|
|
||||||
// Break on error or end of dir.
|
// Break on error or end of dir.
|
||||||
if (res != FR_OK || fno.fname[0] == 0)
|
if (res != FR_OK || fno.fname[0] == 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// Skip official Nintendo dir.
|
||||||
if (is_root && !strcmp(fno.fname, "Nintendo"))
|
if (is_root && !strcmp(fno.fname, "Nintendo"))
|
||||||
{
|
{
|
||||||
path[dirLength] = 0;
|
path[dirLength] = 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set new directory.
|
// Set new directory or file.
|
||||||
memcpy(&path[dirLength], "/", 1);
|
memcpy(&path[dirLength], "/", 1);
|
||||||
fileLength = strlen(fno.fname);
|
fileLength = strlen(fno.fname);
|
||||||
memcpy(&path[dirLength+1], fno.fname, fileLength + 1);
|
memcpy(&path[dirLength+1], fno.fname, fileLength + 1);
|
||||||
|
@ -1967,9 +1971,11 @@ int fix_attributes(char *path, u32 *total, u32 is_root, u32 check_first_run)
|
||||||
if (res != FR_OK)
|
if (res != FR_OK)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear file or folder path.
|
// Clear file or folder path.
|
||||||
path[dirLength] = 0;
|
path[dirLength] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
f_closedir(&dir);
|
f_closedir(&dir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue