summaryrefslogtreecommitdiff
path: root/libpcsxcore
diff options
context:
space:
mode:
authorSND\ckain_cp <SND\ckain_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2014-02-01 10:05:34 +0000
committerSND\ckain_cp <SND\ckain_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97>2014-02-01 10:05:34 +0000
commitb7cde3470383649d6fc07f06f9d1a345052ac21e (patch)
tree4e89799e12d5b722a38d7f2e7052e775f0348a8e /libpcsxcore
parent65a9d3be916addcb8e46b034e08e13bad4fab076 (diff)
downloadpcsxr-b7cde3470383649d6fc07f06f9d1a345052ac21e.tar.gz
CDRISO: when finding .sub, check if .img has two dot suffix. image.img.ecm > image.img.sub > image.sub
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@88766 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore')
-rwxr-xr-xlibpcsxcore/cdriso.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/libpcsxcore/cdriso.c b/libpcsxcore/cdriso.c
index d1400f31..d0aa9a01 100755
--- a/libpcsxcore/cdriso.c
+++ b/libpcsxcore/cdriso.c
@@ -1170,11 +1170,18 @@ static int opensubfile(const char *isoname) {
// copy name of the iso and change extension from .img to .sub
strncpy(subname, isoname, sizeof(subname));
subname[MAXPATHLEN - 1] = '\0';
+
if (strlen(subname) >= 4) {
strcpy(subname + strlen(subname) - 4, ".sub");
}
- else {
- return -1;
+
+ subHandle = fopen(subname, "rb");
+ if (subHandle != NULL) {
+ return 0;
+ }
+
+ if (strlen(subname) >= 8) {
+ strcpy(subname + strlen(subname) - 8, ".sub");
}
subHandle = fopen(subname, "rb");