ESC/P Printer: No longer assume roms/ is where the binary is, fixes #5221.

This commit is contained in:
OBattler
2025-02-17 04:49:43 +01:00
parent 63b223973c
commit 5c4fcfaf85
30 changed files with 300 additions and 19 deletions

View File

@@ -1968,16 +1968,16 @@ escp_init(void *lpt)
dev->ctrl = 0x04;
dev->lpt = lpt;
rom_get_full_path(dev->fontpath, "roms/printer/fonts/");
/* Create a full pathname for the font files. */
if (strlen(exe_path) >= sizeof(dev->fontpath)) {
if (strlen(dev->fontpath) == 0) {
ui_msgbox_header(MBX_ERROR, plat_get_string(STRING_ESCP_ERROR_TITLE),
plat_get_string(STRING_ESCP_ERROR_DESC));
free(dev);
return (NULL);
}
strcpy(dev->fontpath, exe_path);
path_slash(dev->fontpath);
strcat(dev->fontpath, "roms/printer/fonts/");
/* Create the full path for the page images. */
path_append_filename(dev->pagepath, usr_path, "printer");
if (!plat_dir_check(dev->pagepath))