fix: fix ramdisk readdir inconsistency.
This commit is contained in:
@@ -622,8 +622,8 @@ void wp_load_fonts() {
|
||||
if (!raw) continue;
|
||||
int rl = montauk::slen(raw);
|
||||
if (rl == 0 || raw[rl - 1] == '/') continue; // skip directories
|
||||
// readdir may return a full internal path (ramdisk) or a bare name;
|
||||
// take everything after the last '/'.
|
||||
// Current drivers return a bare name; accepting an older ramdisk's
|
||||
// internal path here is harmless and keeps mixed images compatible.
|
||||
const char* base = raw;
|
||||
for (int k = 0; raw[k]; k++) if (raw[k] == '/') base = raw + k + 1;
|
||||
wp_register_font_file(base);
|
||||
|
||||
Reference in New Issue
Block a user