mirror of
https://github.com/CTCaer/hekate.git
synced 2025-08-11 18:50:04 +00:00
move an operation to the beginning of the loop so we don't have to have it twice
This commit is contained in:
parent
31b92d65ce
commit
03fdd19b3a
1 changed files with 3 additions and 6 deletions
|
@ -1938,6 +1938,9 @@ int fix_attributes(char *path, u32 *total, u32 is_root, u32 check_first_run)
|
||||||
dirLength = strlen(path);
|
dirLength = strlen(path);
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
|
// Clear file or folder path.
|
||||||
|
path[dirLength] = 0;
|
||||||
|
|
||||||
// Read a directory item.
|
// Read a directory item.
|
||||||
res = f_readdir(&dir, &fno);
|
res = f_readdir(&dir, &fno);
|
||||||
|
|
||||||
|
@ -1947,10 +1950,7 @@ int fix_attributes(char *path, u32 *total, u32 is_root, u32 check_first_run)
|
||||||
|
|
||||||
// Skip official Nintendo dir.
|
// Skip official Nintendo dir.
|
||||||
if (is_root && !strcmp(fno.fname, "Nintendo"))
|
if (is_root && !strcmp(fno.fname, "Nintendo"))
|
||||||
{
|
|
||||||
path[dirLength] = 0;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
// Set new directory or file.
|
// Set new directory or file.
|
||||||
memcpy(&path[dirLength], "/", 1);
|
memcpy(&path[dirLength], "/", 1);
|
||||||
|
@ -1972,9 +1972,6 @@ 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.
|
|
||||||
path[dirLength] = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
f_closedir(&dir);
|
f_closedir(&dir);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue