1
0
Fork 0

Workaround for using (windows) directories insides cue files on Linux.

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3830
This commit is contained in:
Peter Veenstra 2013-05-21 18:15:15 +00:00
parent c041f14071
commit 8e017c87c3

View file

@ -658,7 +658,30 @@ bool CDROM_Interface_Image::GetRealFileName(string &filename, string &pathname)
return true;
}
}
#if defined (WIN32) || defined(OS2)
//Nothing
#else
//Consider the possibility that the filename has a windows directory seperator (inside the CUE file)
//which is common for some commercial rereleases of DOS games using DOSBox
string copy = filename;
size_t l = copy.size();
for (size_t i = 0; i < l;i++) {
if(copy[i] == '\\') copy[i] = '/';
}
if (stat(copy.c_str(), &test) == 0) {
filename = copy;
return true;
}
tmpstr = pathname + "/" + copy;
if (stat(tmpstr.c_str(), &test) == 0) {
filename = tmpstr;
return true;
}
#endif
return false;
}