1
0
Fork 0

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:
ripsaw8080 2018-10-11 14:58:18 +00:00
parent c7e6b3ca86
commit c3aca8dc44

View file

@ -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);