forked from Mirror/GodMode9
Fix too menu entries in dir crashing GM9
... happened when there where more than 1024 entries.
This commit is contained in:
parent
6a0391bb86
commit
02f5abb877
@ -142,12 +142,12 @@ bool GetDirContentsWorker(DirStruct* contents, char* fpath, int fnsize, const ch
|
|||||||
entry->size = fno.fsize;
|
entry->size = fno.fsize;
|
||||||
}
|
}
|
||||||
entry->marked = 0;
|
entry->marked = 0;
|
||||||
if (contents->n_entries >= MAX_DIR_ENTRIES) {
|
if (!recursive || (entry->type != T_DIR)) {
|
||||||
ret = true; // Too many entries, still okay
|
if (++(contents->n_entries) >= MAX_DIR_ENTRIES) {
|
||||||
break;
|
ret = true; // Too many entries, still okay if we stop here
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!recursive || (entry->type != T_DIR))
|
|
||||||
contents->n_entries++;
|
|
||||||
}
|
}
|
||||||
if (recursive && (fno.fattrib & AM_DIR)) {
|
if (recursive && (fno.fattrib & AM_DIR)) {
|
||||||
if (!GetDirContentsWorker(contents, fpath, fnsize, pattern, recursive))
|
if (!GetDirContentsWorker(contents, fpath, fnsize, pattern, recursive))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user