When searching CD-ROM directory entries, strip trailing period of extension-less filenames after stripping file version number and separator. Fixes disc check in Air Power.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4167
This commit is contained in:
parent
c7e6b3ca86
commit
c3aca8dc44
1 changed files with 7 additions and 12 deletions
|
@ -722,23 +722,18 @@ bool CMscdex::GetDirectoryEntry(Bit16u drive, bool copyFlag, PhysPt pathname, Ph
|
|||
}
|
||||
nameLength = mem_readb(defBuffer+index+32);
|
||||
MEM_StrCopy(defBuffer+index+33,entryName,nameLength);
|
||||
// strip separator and file version number
|
||||
char* separator = strchr(entryName,';');
|
||||
if (separator) *separator = 0;
|
||||
// strip trailing period
|
||||
size_t entrylen = strlen(entryName);
|
||||
if (entrylen>0 && entryName[entrylen-1]=='.') entryName[entrylen-1] = 0;
|
||||
|
||||
if (strcmp(entryName,useName)==0) {
|
||||
//LOG(LOG_MISC,LOG_ERROR)("MSCDEX: Get DirEntry : Found : %s",useName);
|
||||
foundName = true;
|
||||
break;
|
||||
}
|
||||
/* Xcom Apocalipse searches for MUSIC. and expects to find MUSIC;1
|
||||
* All Files on the CDROM are of the kind blah;1
|
||||
*/
|
||||
char* longername = strchr(entryName,';');
|
||||
if(longername) {
|
||||
*longername = 0;
|
||||
if (strcmp(entryName,useName)==0) {
|
||||
//LOG(LOG_MISC,LOG_ERROR)("MSCDEX: Get DirEntry : Found : %s",useName);
|
||||
foundName = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
index += entryLength;
|
||||
} while (index+33<=2048);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue