mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 13:42:47 +00:00
Fix an exception for big file searches
This commit is contained in:
parent
698ad9d891
commit
2791b42f6e
@ -151,6 +151,10 @@ bool GetDirContentsWorker(DirStruct* contents, char* fpath, int fnsize, const ch
|
||||
break;
|
||||
} else if (!pattern || (fvx_match_name(fname, pattern) == FR_OK)) {
|
||||
DirEntry* entry = &(contents->entry[contents->n_entries]);
|
||||
if (contents->n_entries >= MAX_DIR_ENTRIES) {
|
||||
ret = true; // Too many entries, still okay if we stop here
|
||||
break;
|
||||
}
|
||||
strncpy(entry->path, fpath, 256);
|
||||
entry->path[255] = '\0';
|
||||
entry->p_name = fname - fpath;
|
||||
@ -163,12 +167,8 @@ bool GetDirContentsWorker(DirStruct* contents, char* fpath, int fnsize, const ch
|
||||
entry->size = fno.fsize;
|
||||
}
|
||||
entry->marked = 0;
|
||||
if (!recursive || (entry->type != T_DIR)) {
|
||||
if (++(contents->n_entries) >= MAX_DIR_ENTRIES) {
|
||||
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 (!GetDirContentsWorker(contents, fpath, fnsize, pattern, recursive))
|
||||
|
Loading…
x
Reference in New Issue
Block a user