Fix font search on Android
This commit is contained in:
parent
d7c9dfe2de
commit
84226422b5
|
@ -496,18 +496,18 @@ static void fontSetEnumCB(void *data, const char *dir,
|
|||
}
|
||||
|
||||
/* Basically just a case-insensitive search
|
||||
* for the folder "Fonts"... */
|
||||
* for all folders starting with "Fonts"... */
|
||||
static void findFontsFolderCB(void *data, const char *,
|
||||
const char *fname)
|
||||
{
|
||||
size_t i = 0;
|
||||
char buffer[512];
|
||||
char buffer[6];
|
||||
const char *s = fname;
|
||||
|
||||
while (s && i < sizeof(buffer))
|
||||
buffer[i++] = tolower(*s++);
|
||||
|
||||
buffer[i] = '\0';
|
||||
buffer[5] = '\0';
|
||||
|
||||
if (strcmp(buffer, "fonts") == 0)
|
||||
PHYSFS_enumerateFilesCallback(fname, fontSetEnumCB, data);
|
||||
|
@ -517,7 +517,7 @@ void FileSystem::initFontSets(SharedFontState &sfs)
|
|||
{
|
||||
FontSetsCBData d = { p, &sfs };
|
||||
|
||||
PHYSFS_enumerateFilesCallback(".", findFontsFolderCB, &d);
|
||||
PHYSFS_enumerateFilesCallback("", findFontsFolderCB, &d);
|
||||
}
|
||||
|
||||
struct OpenReadEnumData
|
||||
|
|
Loading…
Reference in New Issue