From: notaz Date: Thu, 10 Aug 2023 23:01:11 +0000 (+0300) Subject: misc: accept a path without slash X-Git-Tag: r24l~252 X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=867297aeb2a72b578b2799476e76bf1a59662468;p=pcsx_rearmed.git misc: accept a path without slash --- diff --git a/libpcsxcore/misc.c b/libpcsxcore/misc.c index 252e1c8c..bba81b1e 100644 --- a/libpcsxcore/misc.c +++ b/libpcsxcore/misc.c @@ -304,10 +304,16 @@ int LoadCdromFile(const char *filename, EXE_HEADER *head) { u8 time[4],*buf; u8 mdir[4096]; char exename[256]; + const char *p1, *p2; u32 size, addr; void *mem; - sscanf(filename, "cdrom:\\%255s", exename); + p1 = filename; + if ((p2 = strchr(p1, ':'))) + p1 = p2 + 1; + while (*p1 == '\\') + p1++; + snprintf(exename, sizeof(exename), "%s", p1); time[0] = itob(0); time[1] = itob(2); time[2] = itob(0x10);