From 84226422b54174ac324a3ef53057335449cc8d29 Mon Sep 17 00:00:00 2001 From: RadialApps Date: Sat, 12 Aug 2017 17:25:45 +0530 Subject: [PATCH] Fix font search on Android --- src/filesystem.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/filesystem.cpp b/src/filesystem.cpp index d7fd36b..6ecb280 100644 --- a/src/filesystem.cpp +++ b/src/filesystem.cpp @@ -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