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:
parent
c041f14071
commit
8e017c87c3
1 changed files with 24 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue