Skip to content

Commit ba9cc6e

Browse files
author
ripsaw8080
committed
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.
git-svn-id: http://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4167 ed541006-0bf7-43e9-8c4d-6fc63c346d47
1 parent 1baaf26 commit ba9cc6e

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

src/dos/dos_mscdex.cpp

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -722,23 +722,18 @@ bool CMscdex::GetDirectoryEntry(Bit16u drive, bool copyFlag, PhysPt pathname, Ph
722722
}
723723
nameLength = mem_readb(defBuffer+index+32);
724724
MEM_StrCopy(defBuffer+index+33,entryName,nameLength);
725+
// strip separator and file version number
726+
char* separator = strchr(entryName,';');
727+
if (separator) *separator = 0;
728+
// strip trailing period
729+
size_t entrylen = strlen(entryName);
730+
if (entrylen>0 && entryName[entrylen-1]=='.') entryName[entrylen-1] = 0;
731+
725732
if (strcmp(entryName,useName)==0) {
726733
//LOG(LOG_MISC,LOG_ERROR)("MSCDEX: Get DirEntry : Found : %s",useName);
727734
foundName = true;
728735
break;
729736
}
730-
/* Xcom Apocalipse searches for MUSIC. and expects to find MUSIC;1
731-
* All Files on the CDROM are of the kind blah;1
732-
*/
733-
char* longername = strchr(entryName,';');
734-
if(longername) {
735-
*longername = 0;
736-
if (strcmp(entryName,useName)==0) {
737-
//LOG(LOG_MISC,LOG_ERROR)("MSCDEX: Get DirEntry : Found : %s",useName);
738-
foundName = true;
739-
break;
740-
}
741-
}
742737
index += entryLength;
743738
} while (index+33<=2048);
744739

0 commit comments

Comments
 (0)