From: kub Date: Wed, 21 Feb 2024 18:12:10 +0000 (+0100) Subject: core, system detection by extension in zip files X-Git-Tag: v2.00~114 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bfe516c3a94ab9cc604c73771ea5d8908522d0dd;p=picodrive.git core, system detection by extension in zip files --- diff --git a/pico/media.c b/pico/media.c index 7c147b2f..63d3d997 100644 --- a/pico/media.c +++ b/pico/media.c @@ -138,16 +138,18 @@ static int detect_media(const char *fname, const unsigned char *rom, unsigned in extension_check: /* probably some headerless thing. Maybe check the extension after all. */ + ext_ptr = pmf && *pmf->ext ? pmf->ext : ext; + for (i = 0; i < ARRAY_SIZE(md_exts); i++) - if (strcasecmp(ext, md_exts[i]) == 0) + if (strcasecmp(ext_ptr, md_exts[i]) == 0) goto looks_like_md; for (i = 0; i < ARRAY_SIZE(sms_exts); i++) - if (strcasecmp(ext, sms_exts[i]) == 0) + if (strcasecmp(ext_ptr, sms_exts[i]) == 0) goto looks_like_sms; for (i = 0; i < ARRAY_SIZE(pico_exts); i++) - if (strcasecmp(ext, pico_exts[i]) == 0) + if (strcasecmp(ext_ptr, pico_exts[i]) == 0) goto looks_like_pico; /* If everything else fails, make a guess on the reset vector */