From 867297aeb2a72b578b2799476e76bf1a59662468 Mon Sep 17 00:00:00 2001 From: notaz Date: Fri, 11 Aug 2023 02:01:11 +0300 Subject: [PATCH] misc: accept a path without slash --- libpcsxcore/misc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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); -- 2.39.5