From 3610cc82204326b5229187b70cc10d21595ffd4c Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Sun, 6 Mar 2011 14:52:14 +0000 Subject: [PATCH] Handle files without an extension better. Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3682 --- src/dos/drive_iso.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/dos/drive_iso.cpp b/src/dos/drive_iso.cpp index 6be88895..52e19d5e 100644 --- a/src/dos/drive_iso.cpp +++ b/src/dos/drive_iso.cpp @@ -494,13 +494,13 @@ int isoDrive :: readDirEntry(isoDirEntry *de, Bit8u *data) { if (de->ident[tmp - 1] == '.') de->ident[tmp - 1] = 0; } } - const char* dotpos = strchr((char*)de->ident, '.'); + char* dotpos = strchr((char*)de->ident, '.'); if (dotpos!=NULL) { + if (strlen(dotpos)>4) dotpos[4]=0; if (dotpos-(char*)de->ident>8) { strcpy((char*)(&de->ident[8]),dotpos); } - } - if (strlen((char*)de->ident)>12) de->ident[12]=0; + } else if (strlen((char*)de->ident)>8) de->ident[8]=0; return de->length; }